* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg-gradient-start: #fff5e1;
  --bg-gradient-end: #ffe1ec;
  --bg-card: #ffffff;
  --bg-soft: #fef0d9;
  --text: #2d2d3a;
  --text-dim: #7a7a8e;
  --accent: #ff8c42;
  --accent-dark: #e07a35;
  --danger: #ef476f;
  --danger-dark: #cc395d;
  --success: #06d6a0;
  --success-dark: #05b889;
  --info: #4dabf7;
  --info-dark: #339af0;
  --border: rgba(45, 45, 58, 0.14);
  --border-strong: rgba(45, 45, 58, 0.22);
  --shadow-soft: 0 4px 20px rgba(45, 45, 58, 0.10);
  --shadow-pop: 0 8px 0 0 rgba(0, 0, 0, 0.16);
  --shadow-pop-hover: 0 11px 0 0 rgba(0, 0, 0, 0.16);
  --shadow-pop-press: 0 3px 0 0 rgba(0, 0, 0, 0.16);
}

html, body {
  height: 100%;
  min-height: 100%;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 700;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
}

h1, h2, .tile-name, .tile-empty-label, .record-timer {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: var(--accent-dark); font-weight: 800; }

/* ============================================================
   TOPBAR
   ============================================================ */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h1 {
  font-size: 1.7rem;
  font-weight: 700;
}

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

.grid-select,
.deck-select {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 1rem;
  font-weight: 800;
}

.grid-select-label,
.deck-select-label { color: var(--text-dim); }

.grid-select select,
.deck-select select {
  background: white;
  color: var(--text);
  border: 3px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

.deck-select select {
  max-width: 220px;
  text-overflow: ellipsis;
}

.btn-icon-square {
  background: white;
  color: var(--text);
  border: 3px solid var(--border-strong);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 0 0 var(--border-strong);
  transition: transform 0.1s, background 0.15s;
  font-family: inherit;
  padding: 0;
}

.btn-icon-square:hover { transform: translateY(-1px); background: var(--bg-soft); }
.btn-icon-square:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 0 var(--border-strong);
}

.btn-stop {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--danger);
  color: white;
  border: 3px solid var(--danger-dark);
  padding: 10px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: inherit;
  transition: transform 0.1s, opacity 0.2s;
  box-shadow: 0 4px 0 0 var(--danger-dark);
  opacity: 0.45;
}

.btn-stop:hover { opacity: 1; transform: translateY(-1px); }
.btn-stop:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 0 var(--danger-dark);
}

.btn-stop.active {
  opacity: 1;
  animation: stop-pulse 1.2s infinite;
}

@keyframes stop-pulse {
  0%, 100% { box-shadow: 0 4px 0 0 var(--danger-dark), 0 0 0 0   rgba(239, 71, 111, 0.7); }
  50%      { box-shadow: 0 4px 0 0 var(--danger-dark), 0 0 0 16px rgba(239, 71, 111, 0); }
}

.btn-stop .stop-icon { font-size: 1.15rem; }

.btn-lock {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--text);
  border: 3px solid var(--border-strong);
  padding: 10px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: inherit;
  transition: transform 0.1s, background 0.15s, box-shadow 0.1s;
  box-shadow: 0 4px 0 0 var(--border-strong);
}

.btn-lock:hover { background: var(--bg-soft); }
.btn-lock:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 0 var(--border-strong);
}

.btn-lock.locked {
  background: var(--success);
  color: white;
  border-color: var(--success-dark);
  box-shadow: 0 4px 0 0 var(--success-dark);
}

.btn-lock.locked:hover { background: #07e3aa; }

.btn-lock .lock-icon { font-size: 1.2rem; }

/* ============================================================
   GRID
   ============================================================ */

main {
  padding: 28px 24px 60px;
  max-width: 1400px;
  margin: 0 auto;
}

.grid {
  display: grid;
  gap: 20px;
  width: 100%;
}

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

.tile {
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  background: var(--default-color, #b0b0b0);
  border: 5px solid rgba(255, 255, 255, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 12px;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
  box-shadow: var(--shadow-pop);
  position: relative;
  overflow: hidden;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.28);
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-pop-hover);
}

.tile:active {
  transform: translateY(5px);
  box-shadow: var(--shadow-pop-press);
}

.tile.playing {
  animation: wiggle 0.45s ease-in-out infinite;
  border-color: rgba(255, 255, 255, 0.9);
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg) translateY(-3px); }
  25% { transform: rotate(-2.5deg) translateY(-3px); }
  75% { transform: rotate(2.5deg) translateY(-3px); }
}

.tile.empty {
  background: var(--default-color, #ccc);
  opacity: 0.55;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.7);
  border-width: 4px;
}

.tile.empty:hover { opacity: 0.85; }

body.locked .tile.empty {
  opacity: 0.22;
  cursor: default;
}

body.locked .tile.empty:hover {
  opacity: 0.22;
  transform: none;
  box-shadow: var(--shadow-pop);
}

body.locked .tile.empty .tile-empty-sub { display: none; }

.tile.dragover {
  border-color: white;
  border-style: solid;
  opacity: 1;
  transform: scale(1.04);
}

.tile-emoji {
  font-size: clamp(3.2rem, 12vw, 6.5rem);
  line-height: 1;
  margin-bottom: 6px;
  text-shadow: none;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.25));
}

/* When there's no name, the emoji owns the tile — even bigger, no bottom margin */
.tile-emoji-solo {
  font-size: clamp(4rem, 16vw, 8rem);
  margin-bottom: 0;
}

.tile-name {
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  font-weight: 700;
  text-align: center;
  word-break: break-word;
  line-height: 1.15;
  max-width: 100%;
}

.tile-empty-label {
  font-size: clamp(3.5rem, 10vw, 5rem);
  line-height: 1;
  color: white;
  font-weight: 700;
}

.tile-empty-sub {
  font-size: clamp(0.7rem, 1.3vw, 0.9rem);
  margin-top: 4px;
  font-weight: 800;
  color: white;
  text-transform: lowercase;
  letter-spacing: 0.03em;
}

.tile-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 7px;
  background: white;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  border-radius: 0 4px 4px 0;
}

.tile-loop-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1rem;
  background: white;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  text-shadow: none;
}

/* ============================================================
   HINT (visible only when unlocked)
   ============================================================ */

.hint {
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.75);
  padding: 18px 22px;
  border-radius: 20px;
  border: 3px dashed rgba(45, 45, 58, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
}

.hint-row {
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.4;
}

.hint-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

body.locked .hint { display: none; }

/* ============================================================
   APP FOOTER
   ============================================================ */

.app-footer {
  margin: 40px auto 20px;
  padding: 20px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.app-footer a {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
}

.app-footer a:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
}

.app-footer-sep { opacity: 0.5; }

body.locked .app-footer { display: none; }

/* ============================================================
   MODAL
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(45, 45, 58, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 20px;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--bg-card);
  padding: 26px;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-height: 92vh;
  overflow-y: auto;
  border: 4px solid white;
}

.modal-content h2 {
  font-size: 1.5rem;
  color: var(--text);
}

.modal-content label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--text-dim);
  font-weight: 800;
}

.label-hint {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-dim);
  opacity: 0.8;
}

.modal-content input[type="text"],
.modal-content input[type="password"] {
  background: var(--bg-soft);
  color: var(--text);
  border: 3px solid var(--border);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  width: 100%;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="password"]:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
}

/* ============================================================
   COLOR PICKER
   ============================================================ */

.color-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.color-swatch {
  aspect-ratio: 1;
  border-radius: 10px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 0 3px 0 0 rgba(0, 0, 0, 0.15);
}

.color-swatch:hover { transform: translateY(-2px); box-shadow: 0 5px 0 0 rgba(0, 0, 0, 0.15); }
.color-swatch.selected {
  border-color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 5px 0 0 rgba(0, 0, 0, 0.15);
}

/* ============================================================
   FORM ROWS
   ============================================================ */

.loop-row {
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  background: var(--bg-soft);
  padding: 14px 16px;
  border-radius: 16px;
  cursor: pointer;
  color: var(--text) !important;
  font-weight: 800 !important;
  border: 3px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.loop-row:hover { background: #fce4be; }

.loop-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  cursor: pointer;
  accent-color: var(--success);
}

.loop-row:has(input:checked) {
  border-color: var(--success);
  background: rgba(6, 214, 160, 0.12);
}

.file-row {
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  color: var(--text) !important;
}

.audio-status {
  color: var(--text);
  font-style: italic;
  flex: 1;
  font-size: 0.95rem;
  font-weight: 700;
}

.audio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.audio-actions button { flex: 1 1 auto; min-width: 140px; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ============================================================
   BUTTONS — chunky 3D style
   ============================================================ */

.btn-primary, .btn-secondary, .btn-danger, .btn-danger-soft {
  padding: 12px 20px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out, background 0.15s;
  position: relative;
}

.btn-primary {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 0 0 var(--success-dark);
}

.btn-secondary {
  background: var(--info);
  color: white;
  box-shadow: 0 4px 0 0 var(--info-dark);
}

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 4px 0 0 var(--danger-dark);
}

.btn-danger-soft {
  background: white;
  color: var(--danger);
  border: 3px solid var(--danger);
  box-shadow: 0 4px 0 0 var(--danger);
  padding: 9px 17px;
}

.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover, .btn-danger-soft:hover {
  transform: translateY(-1px);
}

.btn-primary:active, .btn-secondary:active, .btn-danger:active, .btn-danger-soft:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 0 currentColor;
}

.btn-primary:active { box-shadow: 0 1px 0 0 var(--success-dark); }
.btn-secondary:active { box-shadow: 0 1px 0 0 var(--info-dark); }
.btn-danger:active { box-shadow: 0 1px 0 0 var(--danger-dark); }

button:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ============================================================
   FREESOUND SEARCH
   ============================================================ */

.search-modal-content { max-width: 620px; }

.api-key-section {
  background: var(--bg-soft);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.95rem;
  border: 2px solid var(--border);
}

.api-key-section summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
  list-style: none;
}

.api-key-section summary::before {
  content: "▶ ";
  display: inline-block;
  transition: transform 0.15s;
}

.api-key-section[open] summary::before { transform: rotate(90deg); }

.api-key-section #apiKeyStatus { color: var(--text-dim); font-weight: 700; }
.api-key-section #apiKeyStatus.ok { color: var(--success-dark); }

.api-key-body {
  margin-top: 14px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.5;
}

.api-key-body ol { padding-left: 22px; margin: 10px 0; }
.api-key-body li { margin-bottom: 6px; }
.api-key-body input { margin-top: 10px; }
.api-key-body button { margin-top: 10px; }

.search-form { display: flex; gap: 10px; }
.search-form input { flex: 1; }
.search-form button { white-space: nowrap; }

.search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 45vh;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 120px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: 14px;
  border: 2px solid transparent;
}

.search-result:hover { border-color: var(--accent); }

.search-result-info { flex: 1; min-width: 0; }

.search-result-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 700;
}

.btn-icon {
  background: var(--info);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 0 0 var(--info-dark);
  transition: transform 0.1s;
}

.btn-icon:hover { transform: translateY(-1px); }
.btn-icon:active { transform: translateY(2px); box-shadow: 0 1px 0 0 var(--info-dark); }
.btn-icon.active { background: var(--success); box-shadow: 0 3px 0 0 var(--success-dark); }
.btn-icon.active:active { box-shadow: 0 1px 0 0 var(--success-dark); }

.btn-use {
  background: var(--success);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.9rem;
  font-family: inherit;
  flex-shrink: 0;
  box-shadow: 0 3px 0 0 var(--success-dark);
  transition: transform 0.1s;
}

.btn-use:hover { transform: translateY(-1px); }
.btn-use:active { transform: translateY(2px); box-shadow: 0 1px 0 0 var(--success-dark); }

.search-status {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.5;
  font-weight: 700;
}

.search-status.error { color: var(--danger); }

/* ============================================================
   RECORDING
   ============================================================ */

.record-modal-content {
  max-width: 440px;
  align-items: stretch;
}

.record-status {
  text-align: center;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 800;
}

.record-status.error { color: var(--danger); }

.record-timer {
  font-size: 3rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.btn-record {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--danger);
  border: 5px solid white;
  font-size: 3.5rem;
  cursor: pointer;
  color: white;
  align-self: center;
  box-shadow: 0 6px 0 0 var(--danger-dark), 0 10px 30px rgba(239, 71, 111, 0.4);
  transition: transform 0.15s, background 0.2s, box-shadow 0.15s;
  font-family: inherit;
  line-height: 1;
}

.btn-record:hover { transform: translateY(-2px); }
.btn-record:active { transform: translateY(3px); box-shadow: 0 2px 0 0 var(--danger-dark); }

.btn-record.recording {
  background: var(--text);
  border-color: var(--danger);
  box-shadow: 0 6px 0 0 #1a1a26;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 6px 0 0 #1a1a26, 0 0 0 0   rgba(239, 71, 111, 0.7); }
  70%  { box-shadow: 0 6px 0 0 #1a1a26, 0 0 0 28px rgba(239, 71, 111, 0); }
  100% { box-shadow: 0 6px 0 0 #1a1a26, 0 0 0 0   rgba(239, 71, 111, 0); }
}

.record-preview {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.record-preview[hidden] { display: none; }

.record-preview audio { width: 100%; }

/* ============================================================
   AUTH BUTTON + MODAL
   ============================================================ */

.btn-auth {
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: var(--text);
  border: 3px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
  font-family: inherit;
  transition: transform 0.1s, background 0.15s, box-shadow 0.1s;
  box-shadow: 0 3px 0 0 var(--border-strong);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-auth:hover { background: var(--bg-soft); transform: translateY(-1px); }
.btn-auth:active { transform: translateY(2px); box-shadow: 0 1px 0 0 var(--border-strong); }

.btn-auth.signed-in {
  background: var(--success);
  color: white;
  border-color: var(--success-dark);
  box-shadow: 0 3px 0 0 var(--success-dark);
}
.btn-auth.signed-in:hover { background: #07e3aa; }

.btn-auth.anon {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 3px 0 0 var(--accent);
}
.btn-auth.anon:hover { background: #ffe3c1; }

.auth-icon { font-size: 1rem; }

.auth-modal-content { max-width: 420px; gap: 14px; }

.auth-intro {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 700;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: white;
  color: var(--text);
  border: 3px solid var(--border-strong);
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  box-shadow: 0 4px 0 0 var(--border-strong);
  transition: transform 0.1s, background 0.15s;
}

.btn-google:hover { background: var(--bg-soft); transform: translateY(-1px); }
.btn-google:active { transform: translateY(3px); box-shadow: 0 1px 0 0 var(--border-strong); }

.g-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4285f4 0%, #34a853 60%, #fbbc05 80%, #ea4335 100%);
  color: white;
  font-family: 'Fredoka', serif;
  font-weight: 700;
  font-size: 1.1rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--border);
}

.auth-status {
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-dim);
  min-height: 1.4em;
}

.auth-status.error { color: var(--danger); }
.auth-status.ok { color: var(--success-dark); }

/* ============================================================
   DECK MANAGER
   ============================================================ */

.deck-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 80px;
}

.deck-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: 16px;
  border: 3px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.deck-row.active {
  border-color: var(--success);
  background: rgba(6, 214, 160, 0.12);
}

.deck-row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.deck-row-emoji {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}

.deck-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.deck-row-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-row-stats {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 700;
}

.deck-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.deck-act {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 2px solid var(--border-strong);
  background: white;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  padding: 0;
  transition: transform 0.1s, background 0.15s;
}

.deck-act:hover:not(:disabled) { background: var(--bg-soft); transform: translateY(-1px); }
.deck-act:active:not(:disabled) { transform: translateY(1px); }
.deck-act:disabled { opacity: 0.3; cursor: not-allowed; }

.deck-act.danger {
  color: var(--danger);
  border-color: var(--danger);
}

.deck-act.danger:hover:not(:disabled) {
  background: rgba(239, 71, 111, 0.12);
}

/* ============================================================
   EXPLORE (Objev)
   ============================================================ */

.explore-modal-content { max-width: 620px; }

.explore-intro {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 700;
}

.explore-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 120px;
}

.explore-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border-radius: 16px;
  border: 3px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.explore-card:hover { border-color: var(--accent); }

.explore-card-emoji {
  font-size: 2.4rem;
  flex-shrink: 0;
  line-height: 1;
}

.explore-card-info { flex: 1; min-width: 0; }

.explore-card-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.explore-card-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 700;
}

.explore-card-clone {
  flex-shrink: 0;
  white-space: nowrap;
}

.deck-public-row {
  font-size: 0.92rem !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 700px) {
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 1.3rem; }
  main { padding: 18px 14px 40px; }
  .grid { gap: 14px; }
  .grid-select-label,
  .deck-select-label { display: none; }
  .deck-select select { max-width: 140px; padding: 6px 10px; font-size: 0.95rem; }
  .btn-icon-square { width: 38px; height: 38px; }
  .audio-actions button { min-width: 100%; }
  .btn-lock { padding: 8px 14px; font-size: 0.95rem; }
  .tile { border-radius: 22px; border-width: 4px; }
  .hint { padding: 14px 16px; font-size: 0.9rem; }
  .deck-row { padding: 10px 12px; }
  .deck-row-emoji { font-size: 1.7rem; }
  .deck-act { width: 34px; height: 34px; font-size: 0.95rem; }
  .btn-auth { padding: 7px 12px; font-size: 0.9rem; max-width: 110px; }
}

@media (max-width: 420px) {
  .topbar h1 { font-size: 1.1rem; }
  .controls { gap: 6px; }
}
