:root {
  --bg-top: #fff0dd;
  --bg-bottom: #eef9ff;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --text-main: #5b5068;
  --text-soft: #867b95;
  --line-soft: rgba(197, 218, 236, 0.72);
  --line-strong: rgba(138, 168, 201, 0.8);
  --pink: #ff7ba7;
  --pink-deep: #ef4f86;
  --mint: #9fe0b7;
  --sky: #97ccff;
  --gold: #ffd86f;
  --peach: #ffc28c;
  --shadow: 0 28px 52px rgba(139, 164, 199, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.72), transparent 18%),
    radial-gradient(circle at 86% 14%, rgba(255, 255, 255, 0.64), transparent 17%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(8px);
  opacity: 0.44;
}

body::before {
  top: 34px;
  left: -36px;
  width: 180px;
  height: 180px;
  background: rgba(255, 205, 224, 0.5);
}

body::after {
  right: -50px;
  bottom: 56px;
  width: 210px;
  height: 210px;
  background: rgba(255, 228, 154, 0.38);
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.page-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.page-nav a,
.page-footer a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
}

.page-nav a {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 2px solid rgba(230, 218, 202, 0.88);
  box-shadow: 0 10px 18px rgba(139, 164, 199, 0.12);
}

.language-switch {
  display: inline-flex;
  margin-left: auto;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid rgba(230, 218, 202, 0.88);
  box-shadow: 0 10px 18px rgba(139, 164, 199, 0.12);
}

.lang-button {
  min-width: 72px;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.lang-button:hover {
  transform: translateY(-1px);
}

.lang-button:active {
  transform: scale(0.97);
}

.lang-button.active {
  color: white;
  background: linear-gradient(180deg, var(--pink), var(--pink-deep));
}

.hero-card,
.game-panel,
.info-card,
.side-card,
.board-card {
  background: var(--panel);
  backdrop-filter: blur(16px);
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.hero-card,
.game-panel {
  border-radius: 32px;
}

.board-card,
.side-card,
.info-card {
  border-radius: 26px;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  margin-bottom: 18px;
}

.eyebrow,
.mini-label,
.info-label,
.stat-label {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  line-height: 0.96;
}

.subtitle {
  margin-top: 12px;
  max-width: 560px;
  line-height: 1.6;
  color: var(--text-soft);
}

.hero-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-badges span {
  display: inline-grid;
  place-items: center;
  min-width: 72px;
  height: 72px;
  padding: 0 14px;
  border-radius: 22px;
  font-size: 1.7rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.76);
}

.game-panel {
  padding: 22px;
}

.top-bar,
.stats-grid,
.action-row,
.control-row,
.tool-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.top-bar {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.stats-grid {
  align-items: stretch;
}

.stat-pill {
  min-width: 118px;
  padding: 13px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 252, 255, 0.95));
  border: 2px solid rgba(230, 218, 202, 0.84);
}

.stat-pill strong {
  font-size: 1.28rem;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.primary-button,
.secondary-button,
.control-button,
.mode-button,
.number-button {
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 800;
}

.primary-button {
  color: white;
  background: linear-gradient(180deg, var(--pink), var(--pink-deep));
  box-shadow: 0 14px 22px rgba(239, 79, 134, 0.24);
}

.secondary-button,
.control-button,
.mode-button,
.number-button {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid rgba(230, 218, 202, 0.84);
}

.mode-button.active {
  background: linear-gradient(180deg, var(--mint), #7dcfa4);
  color: #234d33;
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.board-card,
.side-card {
  padding: 18px;
}

.board-stage {
  position: relative;
  min-height: 520px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 255, 0.92));
  border: 2px solid rgba(230, 218, 202, 0.82);
}

.board-grid,
.tile-grid,
.memory-grid,
.bubble-grid,
.match-grid,
.link-grid-board,
.reversi-board,
.puzzle-grid {
  display: grid;
  gap: 8px;
}

.board-grid {
  width: min(100%, 560px);
}

.panel-note,
.status-text,
.side-card p,
.info-card p,
.list-card li {
  line-height: 1.55;
  color: var(--text-soft);
}

.status-text {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 2px solid rgba(230, 218, 202, 0.82);
}

.status-text.success {
  color: #2f6e48;
  border-color: rgba(159, 224, 183, 0.92);
  background: rgba(237, 255, 244, 0.92);
}

.status-text.warning {
  color: #8b6131;
  border-color: rgba(255, 216, 111, 0.9);
  background: rgba(255, 249, 231, 0.92);
}

.overlay-card {
  position: absolute;
  inset: 18px;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.84);
  border: 2px solid rgba(230, 218, 202, 0.9);
  box-shadow: 0 18px 30px rgba(139, 164, 199, 0.16);
}

.overlay-card.hidden {
  display: none;
}

.mine-grid {
  grid-template-columns: repeat(9, 1fr);
}

.mine-cell {
  width: min(58px, 8vw);
  aspect-ratio: 1;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 900;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96));
  border: 2px solid rgba(197, 218, 236, 0.8);
}

.mine-cell.revealed {
  background: linear-gradient(180deg, rgba(255, 243, 247, 0.94), rgba(255, 250, 234, 0.96));
}

.mine-cell.flagged {
  background: linear-gradient(180deg, rgba(255, 230, 241, 0.96), rgba(255, 247, 231, 0.96));
}

.memory-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.memory-card {
  aspect-ratio: 1 / 1.08;
  border: 0;
  border-radius: 20px;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 900;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
  border: 2px solid rgba(197, 218, 236, 0.8);
}

.memory-card.revealed,
.memory-card.matched {
  background: linear-gradient(180deg, rgba(255, 245, 249, 0.96), rgba(255, 251, 236, 0.96));
}

.bubble-grid {
  grid-template-columns: repeat(8, 1fr);
}

.bubble-cell {
  width: min(54px, 7.5vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.48);
  border: 2px dashed rgba(197, 218, 236, 0.54);
}

.bubble-cell[data-color="pink"] {
  background: radial-gradient(circle at 30% 30%, #ffd8ec, #ff7fb3);
}

.bubble-cell[data-color="sky"] {
  background: radial-gradient(circle at 30% 30%, #e0f3ff, #86c8ff);
}

.bubble-cell[data-color="mint"] {
  background: radial-gradient(circle at 30% 30%, #e2ffed, #8ee0b0);
}

.bubble-cell[data-color="gold"] {
  background: radial-gradient(circle at 30% 30%, #fff3cf, #ffd86f);
}

.bubble-cell[data-color="peach"] {
  background: radial-gradient(circle at 30% 30%, #ffe8d6, #ffb97f);
}

.queue-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.queue-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 18px rgba(139, 164, 199, 0.14);
}

.breakout-canvas,
.plane-canvas {
  width: min(100%, 560px);
  display: block;
  margin: 0 auto;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 250, 252, 0.98), rgba(242, 249, 255, 0.98));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.82);
}

.link-grid-board,
.match-grid,
.reversi-board,
.puzzle-grid {
  width: min(100%, 560px);
}

.link-grid-board {
  grid-template-columns: repeat(6, 1fr);
}

.link-tile,
.match-tile,
.puzzle-tile {
  aspect-ratio: 1;
  border: 0;
  border-radius: 18px;
  font-size: clamp(1rem, 3vw, 1.7rem);
  font-weight: 900;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96));
  border: 2px solid rgba(197, 218, 236, 0.82);
}

.link-tile.selected,
.match-tile.selected,
.puzzle-tile.selected {
  background: linear-gradient(180deg, rgba(255, 243, 247, 0.98), rgba(255, 251, 236, 0.98));
}

.link-tile.cleared,
.puzzle-tile.empty {
  opacity: 0.16;
  pointer-events: none;
}

.match-grid {
  grid-template-columns: repeat(8, 1fr);
}

.match-tile {
  border-radius: 16px;
}

.reversi-board {
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 8px;
  border-radius: 24px;
  background: linear-gradient(180deg, #9edfb7, #6fbe8e);
}

.reversi-cell {
  aspect-ratio: 1;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
}

.disc {
  width: 72%;
  height: 72%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.disc.black {
  background: #3f4956;
}

.disc.white {
  background: #fff7ec;
}

.reversi-cell.valid::after {
  content: "";
  width: 18%;
  height: 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.56);
}

.puzzle-grid {
  grid-template-columns: repeat(4, 1fr);
}

.puzzle-tile {
  display: grid;
  place-items: center;
}

.fishing-scene {
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(151, 204, 255, 0.42), rgba(159, 224, 183, 0.18) 36%, rgba(255, 236, 180, 0.26) 100%);
  border: 2px solid rgba(197, 218, 236, 0.82);
  text-align: center;
}

.pond-button {
  width: min(100%, 280px);
  min-height: 160px;
  border-radius: 999px 999px 46px 46px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #255276;
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.72), rgba(151, 204, 255, 0.9));
  border: 4px solid rgba(255, 255, 255, 0.74);
  box-shadow: 0 22px 28px rgba(139, 164, 199, 0.2);
}

.upgrade-list,
.catch-list {
  display: grid;
  gap: 10px;
}

.list-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 2px solid rgba(230, 218, 202, 0.82);
}

.page-footer {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.info-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.info-card {
  padding: 18px;
}

.control-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.control-pad .control-button {
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.control-pad .blank {
  visibility: hidden;
}

@media (max-width: 860px) {
  .play-layout {
    grid-template-columns: 1fr;
  }

  .language-switch {
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .memory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .match-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
