:root {
  color-scheme: light;
  --background: #f5f7fb;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #5b6477;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --lingo-correct: #22c55e;
  --lingo-present: #eab308;
  --lingo-absent: #78716c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--text);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.login-view .header {
  justify-content: center;
  text-align: center;
}

.login-view .brand {
  flex-direction: column;
  align-items: center;
}

.login-view .brand-text {
  align-items: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-score {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.logout-button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.logo {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 64px;
}

.header h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.1;
}

.header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.2;
}

.main {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.auth-section {
  display: flex;
  justify-content: center;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
}

.auth-card h2 {
  margin-top: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text);
}

.login-field input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

.login-actions {
  display: flex;
  justify-content: flex-end;
}

.login-actions button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.board-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
}

.board-section.is-locked {
  opacity: 0.6;
}

.board-section.is-locked .board,
.board-section.is-locked .board-toolbar,
.board-section.is-locked .board-header {
  pointer-events: none;
}

.board-section h2 {
  margin-top: 0;
}

.pad-button:focus-visible,
.upload-dropzone:focus-visible,
.upload-actions button:focus-visible,
.login-actions button:focus-visible,
.logout-button:focus-visible,
.back-button:focus-visible,
.icon-button:focus-visible,
.pad-delete:focus-visible,
.set-card-button:focus-visible,
.set-card-delete:focus-visible,
.set-card-rename:focus-visible,
.set-add-dropzone:focus-visible,
.play-text-button:focus-visible,
.set-title-edit:focus-visible,
.word-list-delete:focus-visible,
.primary-button:focus-visible,
#word-add-button:focus-visible,
#game-guess-input:focus-visible,
.game-fullscreen-btn:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.45);
  outline-offset: 2px;
}

.play-button:focus-visible {
  outline: 3px solid rgba(34, 197, 94, 0.5);
  outline-offset: 2px;
}

.status {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
}

.status[data-kind="error"] {
  background: #fee2e2;
  color: #7f1d1d;
}

.status[data-kind="success"] {
  background: #dcfce7;
  color: #166534;
}

.status[data-kind="info"] {
  background: #e0f2fe;
  color: #0c4a6e;
}

.board-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 8px;
  padding-right: 80px;
}

.board-header h2 {
  margin: 0;
}

.hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.board-toolbar {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.icon-button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.hint-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hint-button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.hint-button:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.45);
  outline-offset: 2px;
}

.hint-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  max-width: 200px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.8rem;
  line-height: 1.25;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.hint-tooltip:hover .hint-popover,
.hint-tooltip:focus-within .hint-popover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 900px) {
  .hint-tooltip {
    display: none;
  }
}

.board {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
  gap: 16px;
  justify-content: start;
  align-items: start;
}

.pad-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8fafc;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  max-width: 240px;
  position: relative;
}

.pad-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: #ffffff;
  color: #b91c1c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}

.pad-delete svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pad-delete:hover {
  background: #fee2e2;
}

.pad-card.draggable {
  cursor: grab;
}

.pad-card.is-dragging {
  opacity: 0.6;
  cursor: grabbing;
}

.pad-card.is-drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.pad-button {
  min-height: 120px;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  background-color: var(--pad-base-color, #4f46e5);
  transition:
    transform 0.05s ease,
    box-shadow 0.2s ease,
    background-color 0.4s ease;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
  touch-action: manipulation;
}

.pad-button:active {
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.pad-button.is-playing {
  animation: padPulse 1.6s ease-in-out infinite;
}

@keyframes padPulse {
  0%,
  100% {
    background-color: var(--pad-base-color, #4f46e5);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
  }
  50% {
    background-color: var(--pad-accent-color, #6d67ef);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pad-button.is-playing {
    animation: none;
  }
}


.upload-card {
  border-style: dashed;
  background: #f8fafc;
}

.upload-dropzone {
  min-height: 120px;
  border: 2px dashed #cbd5f5;
  border-radius: 12px;
  background: #eef2ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-weight: 600;
  color: #312e81;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  width: 100%;
}

.upload-dropzone.is-disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.upload-dropzone.is-dragging {
  border-color: var(--primary);
  background: #e0e7ff;
}

.upload-subtitle {
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #4c51bf;
}

.upload-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.upload-file {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.upload-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text);
  width: 100%;
}

.upload-field input[type="text"] {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
  width: 100%;
}

.upload-field input[type="color"] {
  height: 42px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  padding: 2px;
  overflow: hidden;
}

.upload-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.upload-field input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 10px;
}

.upload-field input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 10px;
}

.upload-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

.upload-actions button {
  flex: 1 1 120px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.upload-actions button.secondary {
  background: #e2e8f0;
  color: #1e293b;
}

@media (min-width: 900px) {
  .main {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .board {
    grid-template-columns: repeat(4, minmax(200px, 1fr));
  }
}

@media (max-width: 600px) {
  .brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .board-toolbar {
    top: 16px;
    right: 16px;
  }

  .hint-popover {
    left: 0;
    right: auto;
  }
}

@media (min-width: 721px) and (max-width: 1023px) {
  .board {
    grid-template-columns: repeat(3, minmax(200px, 1fr));
  }
}

@media (max-width: 720px) {
  .board {
    grid-template-columns: repeat(2, minmax(170px, 240px));
  }
}

@media (max-width: 420px) {
  .board {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

/* --- Lingo: set cards --- */
.back-button {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.play-text-button {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--lingo-correct, #22c55e);
  background: var(--lingo-correct, #22c55e);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.play-text-button:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

.play-text-button:focus-visible {
  outline: 3px solid rgba(34, 197, 94, 0.45);
  outline-offset: 2px;
}

.set-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8fafc;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  max-width: 240px;
  position: relative;
}

.set-card.draggable {
  cursor: grab;
}

.set-card.is-dragging {
  opacity: 0.6;
  cursor: grabbing;
}

.set-card.is-drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.set-card-button {
  min-height: 80px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  padding: 12px 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  transition: transform 0.05s ease, box-shadow 0.2s ease;
  width: 100%;
}

.set-card-button:active {
  transform: scale(0.98);
}

.set-card-name {
  display: block;
}

.set-card-meta {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.9;
}

.set-card-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: #ffffff;
  color: #b91c1c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 10;
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.set-card-rename {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 10;
  flex-shrink: 0;
}

.set-card-rename:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.set-card-rename svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.set-card-delete:hover {
  background: #fee2e2;
}

.set-card-delete svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.set-card-edit {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding-top: 10px;
}

.set-card-edit-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: default;
}

.set-card-edit-input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.set-card-save {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.set-card-save:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.45);
  outline-offset: 2px;
}

.set-card-add {
  border-style: dashed;
  background: transparent;
}

.set-add-dropzone {
  min-height: 80px;
  border: 2px dashed #cbd5f5;
  border-radius: 12px;
  background: #eef2ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-weight: 600;
  color: #312e81;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  width: 100%;
}

.set-add-dropzone:hover:not(.is-disabled) {
  border-color: var(--primary);
  background: #e0e7ff;
}

.set-add-dropzone.is-disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.set-add-title {
  display: block;
  font-size: 1rem;
}

.set-add-subtitle {
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #4c51bf;
}

/* --- Set detail --- */
.set-detail-section .board-header {
  padding-right: 50px;
}

.set-detail-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.set-detail-title-row h2 {
  margin: 0;
}

.set-title-edit {
  flex-shrink: 0;
}

.set-title-edit svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.set-detail-actions {
  margin-top: 12px;
  margin-bottom: 16px;
}

.primary-button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.play-button {
  background: var(--lingo-correct, #22c55e);
  border-color: var(--lingo-correct, #22c55e);
  color: #ffffff;
}

.play-button:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

.word-add {
  margin-bottom: 16px;
}

.word-add-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 6px;
}

.word-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.word-add-row input {
  flex: 1 1 140px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
}

.word-add-row button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.word-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-list-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  cursor: grab;
}

.word-list-item:active {
  cursor: grabbing;
}

.word-list-item.word-list-item-dragging {
  opacity: 0.6;
}

.word-list-item.word-list-item-drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.word-list-delete {
  padding: 0;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.word-list-delete:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* --- Game --- */
.game-section {
  position: relative;
}

.game-fullscreen-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  display: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.game-fullscreen-btn .game-fullscreen-icon {
  width: 16px;
  height: 16px;
}

.game-fullscreen-btn .game-fullscreen-icon--shrink {
  display: none;
}

.game-fullscreen-btn.is-active .game-fullscreen-icon--expand {
  display: none;
}

.game-fullscreen-btn.is-active .game-fullscreen-icon--shrink {
  display: block;
}

.game-fullscreen-btn:hover {
  background: var(--background);
  color: var(--text);
}

@media (min-width: 1024px) {
  .game-fullscreen-btn {
    display: inline-flex;
  }
}

.game-section.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  border-radius: 0;
  border: none;
  box-shadow: none;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-section.is-fullscreen .game-fullscreen-btn {
  top: 16px;
  right: 16px;
}

.game-score-fullscreen {
  display: none;
}

.game-section.is-fullscreen .game-score-fullscreen {
  display: block;
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
}

.game-section.is-fullscreen .board-header {
  margin-top: 8px;
  margin-bottom: 0;
  align-self: flex-start;
  width: 100%;
  text-align: left;
}

.game-section.is-fullscreen .board-header h2 {
  margin: 0 0 8px 0;
}

.game-section.is-fullscreen .game-input-area {
  position: absolute;
  bottom: 16px;
  left: 16px;
  margin: 0;
}

.game-section.is-fullscreen .lingo-grid {
  margin-top: 12px;
  margin-bottom: 80px;
  flex: 1;
  justify-content: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-section.is-fullscreen .lingo-row {
  gap: 12px;
}

.game-section.is-fullscreen .lingo-cell {
  width: clamp(56px, 10vmin, 88px);
  height: clamp(56px, 10vmin, 88px);
  font-size: clamp(1.2rem, 4vmin, 2rem);
}

.game-section.is-fullscreen .lingo-cell-revealed::before {
  inset: 6px;
}

.lingo-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 20px;
}

.lingo-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.lingo-answer-row {
  margin-top: 12px;
}

.lingo-cell-wrong::before {
  background: #b91c1c;
}

.lingo-cell-wrong {
  color: #fff;
}

.lingo-cell {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--panel);
}

.lingo-cell-input {
  border-style: dashed;
  background: #f8fafc;
}

.lingo-cell-revealed {
  color: #ffffff;
  background: var(--panel);
  position: relative;
}

.lingo-cell-revealed::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  z-index: 0;
}

.lingo-cell-revealed .lingo-cell-letter {
  position: relative;
  z-index: 1;
}

.lingo-cell-correct::before {
  background: var(--lingo-correct);
}

.lingo-cell-present::before {
  background: var(--lingo-present);
}

.lingo-cell-present {
  color: #1c1917;
}

.lingo-cell-absent::before {
  background: var(--lingo-absent);
}

.game-input-area {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.game-input-area.game-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-input-area input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1.1rem;
  width: 200px;
  max-width: 100%;
  text-transform: lowercase;
}

/* Verborgen invoer: typen gaat direct naar de vakjes */
.game-guess-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  opacity: 0;
}

.game-input-area button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.game-hint-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
}

.game-hint-button:hover {
  background: #f1f5f9;
  color: var(--text);
  border-color: var(--primary);
}

.game-score {
  margin: 4px 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.game-result {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.game-result-won {
  color: #166534;
}

.game-result-lost {
  color: #7f1d1d;
}

.game-complete-overview {
  margin-top: 24px;
  padding: 24px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.game-complete-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  color: var(--text);
}

.game-complete-score {
  margin: 0 0 20px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--lingo-correct, #22c55e);
}

.game-complete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Confetti overlay */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confetti-fall linear forwards;
}

.confetti-piece.rect {
  border-radius: 2px;
}

.confetti-piece.circle {
  border-radius: 50%;
}

@keyframes confetti-fall {
  to {
    transform: translateY(100vh) rotate(720deg);
  }
}
