* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background: #0C0D14;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  font-family: 'Courier New', monospace;
  color: #fff;
  overflow: auto;
}

#game-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 620px;
  padding: 12px;
  gap: 10px;
}

#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  background: #13141D;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.hud-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #888;
  text-transform: uppercase;
}

.hud-value {
  font-size: 22px;
  font-weight: 700;
  color: #00ff88;
}

.hud-buttons {
  display: flex;
  gap: 6px;
}

.hud-btn {
  background: #1a1a2e;
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 6px 12px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.hud-btn:hover {
  background: #00ff88;
  color: #0C0D14;
}

#board-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: visible;
}

#board {
  position: relative;
  width: 560px;
  height: 400px;
}

.tile {
  position: absolute;
  width: 38px;
  height: 50px;
  background: #1e2030;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.3s;
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 2px 5px 12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tile.selected {
  border-color: #00ff88;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
}

.tile.hint {
  border-color: #ffcc00;
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
}

.tile.blocked {
  cursor: default;
  opacity: 0.5;
}

.tile.removing {
  opacity: 0;
  transform: scale(0.5);
}

/* Tile suit background tints for visual grouping */
.tile.suit-dot { background: #1a2238; }
.tile.suit-bam { background: #1a2820; }
.tile.suit-char { background: #281a20; }
.tile.suit-wind { background: #28261a; }
.tile.suit-dragon { background: #221a28; }
.tile.suit-flower { background: #281a26; }
.tile.suit-season { background: #1a2628; }

/* Layer depth effect */
.tile.layer-0 { background: #181a28; }
.tile.layer-1 { background: #1e2030; }
.tile.layer-2 { background: #242638; }
.tile.layer-3 { background: #2a2c40; }
.tile.layer-4 { background: #303248; }

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#overlay.hidden {
  display: none;
}

#overlay-box {
  background: #13141D;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  max-width: 400px;
}

#overlay-box h1 {
  font-size: 36px;
  margin-bottom: 12px;
  letter-spacing: 4px;
  color: #00ff88;
}

.subtitle {
  color: #aaa;
  font-size: 14px;
  margin-bottom: 8px;
}

.controls-hint {
  color: #666;
  font-size: 12px;
  margin-bottom: 24px;
}

.game-btn {
  background: #00ff88;
  color: #0C0D14;
  border: none;
  padding: 14px 28px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.game-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.hidden {
  display: none !important;
}

@media (max-width: 620px) {
  #board {
    transform: scale(0.75);
    transform-origin: top center;
  }
}
