:root {
  --bg0: #0b1220;
  --bg1: #0b1624;
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.7);

  --card-border: rgba(255, 255, 255, 0.18);
  --card-bg: rgba(255, 255, 255, 0.94);

  --shadow: rgba(0, 0, 0, 0.35);
  --shadow-soft: rgba(0, 0, 0, 0.22);

  --panel: rgba(255, 255, 255, 0.08);
  --panel-border: rgba(255, 255, 255, 0.12);

  --good: #36d399;
  --bad: #fb7185;
  --hint: #fbbf24;

  --ring: rgba(96, 165, 250, 0.65);
  --ring2: rgba(168, 85, 247, 0.55);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  background:
    radial-gradient(1100px 700px at 20% 10%, rgba(255, 255, 255, 0.06), transparent 60%),
    radial-gradient(900px 650px at 85% 20%, rgba(96, 165, 250, 0.10), transparent 62%),
    radial-gradient(900px 650px at 75% 90%, rgba(168, 85, 247, 0.06), transparent 65%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  color: var(--text);
}

.stage {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 28px 44px;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.title {
  font-size: 18px;
  letter-spacing: 0.2px;
  font-weight: 650;
  color: var(--text);
}

.subtitle {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.92;
  color: var(--muted);
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 0px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
}

.control-label {
  font-size: 12px;
  opacity: 0.85;
}

button.secondary {
  font-size: 14px;
  padding: 7px 10px;
  border-radius: 0px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease,
    box-shadow 140ms ease;
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22);
}

button.primary {
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 0px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease,
    box-shadow 140ms ease;
}

button.primary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
}

button.primary:active,
button.secondary:active,
button.mini:active {
  transform: translateY(0px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.statusBar {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 0px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
}

.pillLabel {
  font-size: 12px;
  opacity: 0.9;
  color: var(--muted);
}

button.mini {
  margin-left: 8px;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 0px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

button.mini:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.keys {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 28px;
  justify-items: center;
  margin-bottom: 26px;
  position: relative;
}

.keysTitle {
  grid-column: 1 / -1;
  justify-self: center;
  font-size: 16px;
  margin-bottom: 2px;
  opacity: 0.95;
  color: var(--muted);
}

.cardWrap {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 10px;
}

.cardWrap.dropzone {
  border-radius: 0px;
  padding: 6px;
  transition: transform 140ms ease;
}

.cardWrap.dropzone:hover {
  transform: translateY(-1px);
}

.cardWrap.dropzone.dragOver {
  outline: 4px dashed rgba(255, 255, 255, 0.65);
  outline-offset: 6px;
}

.cardWrap:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 6px;
  border-radius: 0px;
}

.label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.card {
  width: 170px;
  height: 220px;
  border: 1px solid var(--card-border);
  border-radius: 0px;
  background: var(--card-bg);
  box-shadow: 0 18px 40px var(--shadow-soft);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(96, 165, 250, 0.14), transparent 50%),
    radial-gradient(600px 200px at 50% 100%, rgba(168, 85, 247, 0.10), transparent 55%);
  pointer-events: none;
}

.glyphs {
  width: 86%;
  height: 86%;
  display: grid;
  place-items: center;
  gap: 10px;
}

.layout-single {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.layout-2-vertical {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 18px;
}

.layout-2x2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}

.layout-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}

.layout-3 .glyph:nth-child(1) {
  grid-column: 1 / span 1;
  grid-row: 1 / span 1;
}
.layout-3 .glyph:nth-child(2) {
  grid-column: 2 / span 1;
  grid-row: 1 / span 1;
}
.layout-3 .glyph:nth-child(3) {
  grid-column: 1 / span 2;
  grid-row: 2 / span 1;
  justify-self: center;
}

.glyph {
  width: 58px;
  height: 58px;
  fill: currentColor;
}

.red {
  color: #e53935;
}
.yellow {
  color: #f6c026;
}
.green {
  color: #43a047;
}
.blue {
  color: #1e88e5;
}

.deckArea {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  border-radius: 0px;
  backdrop-filter: blur(10px);
  padding: 16px;
}

.deckHeader {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.deckTitle {
  font-size: 15px;
  opacity: 0.92;
}

.deckHint {
  font-size: 12px;
  opacity: 0.9;
  color: var(--muted);
}

.deckGrid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 14px;
}

.deckCard {
  width: 120px;
  height: 150px;
  border: 1px solid var(--card-border);
  border-radius: 0px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
  display: grid;
  place-items: center;
  cursor: grab;
  user-select: none;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.deckCard:hover {
  transform: translateY(-2px);
  filter: brightness(1.02);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.30);
}

.deckCard:active {
  cursor: grabbing;
}

.deckCard.dragging {
  opacity: 0.4;
}

.deckCard .glyph {
  width: 40px;
  height: 40px;
}

.bottomRow {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback {
  min-height: 22px;
  font-size: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 0px;
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
  flex: 1 1 520px;
}

.hint {
  outline: 4px solid rgba(251, 191, 36, 0.9);
  outline-offset: 7px;
  border-radius: 0px;
}

.correct {
  outline: 4px solid rgba(54, 211, 153, 0.85);
  outline-offset: 7px;
  border-radius: 0px;
}

.wrong {
  outline: 4px solid rgba(251, 113, 133, 0.82);
  outline-offset: 7px;
  border-radius: 0px;
}

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.legendItem {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 10px;
  border-radius: 0px;
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.ok {
  background: var(--good);
}
.dot.no {
  background: var(--bad);
}
.dot.dotHint {
  background: var(--hint);
}

@media (max-width: 720px) {
  .title-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .keys {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
    gap: 18px;
  }
  .deckGrid {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
  }
}

