:root {
  --bg-a: #090513;
  --bg-b: #110a24;
  --ink: #f9f5ff;
  --muted: #cfbee7;
  --panel: rgba(20, 14, 40, 0.72);
  --panel-border: rgba(168, 85, 247, 0.3);
  --shadow: 0 12px 30px rgba(2, 4, 18, 0.35);
  --accent: #d946ef;
  --accent-soft: rgba(217, 70, 239, 0.25);
  --success: #86efac;
  --warning: #fcd34d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 18% 10%, #24155a 0%, var(--bg-b) 40%, var(--bg-a) 100%);
}

body {
  min-height: 100vh;
}

.secrets-mobile {
  width: min(100%, 640px);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  display: grid;
  gap: 14px;
}

.secrets-header {
  background: linear-gradient(145deg, rgba(18, 10, 40, 0.84), rgba(8, 8, 24, 0.94));
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.secrets-kicker {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
  font-size: 0.7rem;
}

.secrets-header h1 {
  margin: 8px 0 6px;
  font-size: clamp(1.35rem, 6vw, 1.85rem);
  line-height: 1.2;
}

.secrets-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tab-button {
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(18, 14, 36, 0.9);
  color: var(--ink);
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
}

.tab-button.is-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), rgba(29, 16, 56, 0.95));
  box-shadow: 0 0 0 1px rgba(217, 70, 239, 0.3);
}

.tab-panel {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.tab-panel.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.secrets-list,
.simple-list,
.score-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.secrets-list {
  display: grid;
  gap: 10px;
}

.secrets-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.score-list {
  counter-reset: score;
}

.tab-section-title {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--text);
}

.secret-card,
.simple-card,
.score-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  animation: cardIn 360ms ease both;
  animation-delay: calc(var(--card-index, 0) * 45ms);
}

.secret-card {
  box-shadow: 0 12px 24px rgba(2, 4, 18, 0.34), 0 0 18px rgba(217, 70, 239, 0.18);
}

.secret-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(40, 20, 80, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  word-wrap: break-word;
  white-space: normal;
  height: auto;
}

.secret-card p,
.simple-title {
  margin: 0;
  line-height: 1.4;
  font-size: 0.98rem;
}

.secret-card p {
  text-wrap: balance;
}

.secret-card-empty {
  color: var(--muted);
  text-align: center;
  width: 100%;
  aspect-ratio: auto;
  min-height: 84px;
}

.secret-card-discovered {
  border-color: rgba(134, 239, 172, 0.45);
  justify-content: center;
  flex-direction: column;
}

.secret-owner {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.status-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-badge {
  margin-bottom: 8px;
  padding: 5px 10px;
  background: rgba(134, 239, 172, 0.18);
  color: var(--success);
  border: 1px solid rgba(134, 239, 172, 0.45);
}

.simple-card,
.score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.simple-title {
  font-weight: 600;
}

.status-pill {
  padding: 4px 8px;
  border: 1px solid transparent;
}

.status-pill.is-discovered {
  color: var(--success);
  background: rgba(134, 239, 172, 0.14);
  border-color: rgba(134, 239, 172, 0.35);
}

.status-pill.is-hidden {
  color: var(--warning);
  background: rgba(252, 211, 77, 0.11);
  border-color: rgba(252, 211, 77, 0.35);
}


.status-pill.is-not-submitted {
  color: rgba(191, 219, 254, 0.95);
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.32);
  opacity: 0.88;
}

.simple-card.has-discovered-secret {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.discovered-secret-text {
  margin: 0;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(134, 239, 172, 0.45);
  background: rgba(134, 239, 172, 0.18);
  color: #d9ffe8;
  padding: 10px 12px;
  line-height: 1.45;
  box-shadow: inset 0 0 0 1px rgba(134, 239, 172, 0.15), 0 0 16px rgba(134, 239, 172, 0.12);
}

.score-rank {
  color: #7dd3fc;
  font-weight: 700;
  font-size: 0.78rem;
  min-width: 30px;
}

.score-points {
  font-weight: 800;
  color: #fde047;
}

.buzzer-form {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.buzzer-intro {
  margin: 0 0 4px;
  color: var(--muted);
  line-height: 1.4;
}

.buzzer-label {
  font-size: 0.84rem;
  font-weight: 700;
}

.buzzer-form select,
.buzzer-form input,
.buzzer-submit {
  width: 100%;
  border-radius: 11px;
  border: 1px solid rgba(168, 85, 247, 0.36);
  background: rgba(10, 10, 26, 0.6);
  color: var(--ink);
  padding: 11px 12px;
}

.buzzer-submit {
  margin-top: 4px;
  border-color: rgba(217, 70, 239, 0.6);
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.86), rgba(76, 29, 149, 0.9));
  font-weight: 700;
}

.buzzer-secret-results {
  margin: -2px 0 4px;
  padding: 6px;
  list-style: none;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.28);
  background: rgba(7, 7, 22, 0.92);
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.12), 0 12px 22px rgba(3, 7, 18, 0.4);
  max-height: 210px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}

.buzzer-secret-result-item {
  margin: 0;
}

.buzzer-secret-result-button {
  width: 100%;
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.35);
  color: var(--ink);
  padding: 11px 12px;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.35;
}

.buzzer-secret-result-button:active,
.buzzer-secret-result-button:focus-visible {
  border-color: rgba(217, 70, 239, 0.7);
  background: rgba(147, 51, 234, 0.24);
  outline: none;
}

.buzzer-secret-result-button.is-disabled,
.buzzer-secret-result-button.is-disabled:active,
.buzzer-secret-result-button.is-disabled:focus-visible {
  opacity: 0.6;
  cursor: not-allowed;
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(51, 65, 85, 0.35);
}

.buzzer-feedback {
  margin: 4px 0 0;
  min-height: 20px;
  font-weight: 700;
}

.buzzer-feedback.is-success {
  color: var(--success);
}

.buzzer-feedback.is-error {
  color: #fca5a5;
}

.buzzer-feedback-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.buzz-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 22px;
  text-align: center;
  color: #fff;
}

.buzz-result-overlay[hidden] {
  display: none;
}

.buzz-result-overlay.is-true {
  background: rgba(22, 163, 74, 0.97);
}

.buzz-result-overlay.is-false {
  background: rgba(185, 28, 28, 0.97);
}

.buzz-result-overlay__content {
  max-width: 420px;
  display: grid;
  gap: 12px;
}

.buzz-result-overlay__title {
  margin: 0;
  font-size: clamp(2.1rem, 8vw, 3.4rem);
  font-weight: 900;
}

.buzz-result-overlay__text {
  margin: 0;
  font-size: clamp(1.15rem, 4.8vw, 1.55rem);
  font-weight: 700;
}

.buzz-result-overlay__points {
  margin: 0;
  font-size: clamp(1.2rem, 5vw, 1.8rem);
  font-weight: 800;
}

.buzz-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.buzz-history-state {
  margin: 0;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(168, 85, 247, 0.28);
  background: rgba(13, 11, 30, 0.82);
  color: var(--muted);
  text-align: center;
  box-shadow: var(--shadow);
}

.buzz-history-card {
  background: linear-gradient(145deg, rgba(45, 22, 88, 0.88), rgba(15, 10, 36, 0.96));
  border: 1px solid rgba(217, 70, 239, 0.34);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(2, 4, 18, 0.45), 0 0 18px rgba(217, 70, 239, 0.2);
  display: grid;
  gap: 9px;
  animation: cardIn 360ms ease both;
  animation-delay: calc(var(--card-index, 0) * 35ms);
}

.buzz-history-head {
  display: grid;
  gap: 8px;
}

.buzz-history-players,
.buzz-history-time,
.buzz-history-secret {
  margin: 0;
  line-height: 1.42;
}

.buzz-history-players {
  font-weight: 700;
}

.buzz-history-time {
  color: var(--muted);
  font-size: 0.86rem;
}

.buzz-history-secret {
  color: #f4edff;
  font-size: 0.94rem;
}

.buzz-history-status {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.buzz-history-status.is-pending {
  color: #ffe38c;
  background: rgba(250, 204, 21, 0.15);
  border-color: rgba(250, 204, 21, 0.45);
}

.buzz-history-status.is-correct {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.44);
}

.buzz-history-status.is-wrong {
  color: #fecaca;
  background: rgba(220, 38, 38, 0.17);
  border-color: rgba(248, 113, 113, 0.46);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.secret-submission-status {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.85rem;
}

.secret-submission-group {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.42);
  padding: 0.85rem 0.95rem;
}

.secret-submission-group h2 {
  margin: 0;
  font-size: 1rem;
}

.secret-submission-group p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.secret-submission-group ul {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.secret-submission-group li {
  font-weight: 600;
}

.secret-submission-group .secret-submission-chips {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.secret-submission-group .secret-submission-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.33rem 0.7rem;
  border: 1px solid rgba(110, 231, 183, 0.45);
  background: rgba(6, 78, 59, 0.48);
  color: #d1fae5;
  font-size: 0.86rem;
  line-height: 1.2;
  font-weight: 700;
  width: auto;
}

.secret-submission-group--validated {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(20, 83, 45, 0.26);
}

.secret-submission-group--pending {
  border-color: rgba(250, 204, 21, 0.42);
  background: rgba(113, 63, 18, 0.26);
}

.secret-submission-group--missing {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.2);
}

@media (min-width: 700px) {
  .tabs {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

#tab-monsecret .secret-entry-card {
  border-radius: 24px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: linear-gradient(165deg, rgba(38, 21, 69, 0.95) 0%, rgba(20, 14, 40, 0.82) 100%);
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.16), var(--shadow);
  padding: clamp(1.2rem, 3.5vw, 2rem);
  display: grid;
  gap: 1rem;
}

#tab-monsecret .secret-entry-card.shake {
  animation: monSecretShake 380ms ease;
}

#tab-monsecret .secret-entry-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  font-weight: 700;
  color: #f5d0fe;
}

#tab-monsecret .secret-entry-title {
  margin: 0;
  font-size: clamp(1.75rem, 4.4vw, 2.35rem);
  letter-spacing: 0.04em;
}

#tab-monsecret .secret-entry-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

#tab-monsecret .secret-entry-welcome {
  margin: 0;
  font-size: 1.07rem;
  font-weight: 700;
}

#tab-monsecret .secret-entry-form {
  display: grid;
  gap: 0.85rem;
}

#tab-monsecret .secret-entry-form-login {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

#tab-monsecret .secret-entry-form-secret {
  grid-template-columns: 1fr;
}

#tab-monsecret .secret-entry-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.92rem;
  color: var(--muted);
}

#tab-monsecret .secret-entry-card input,
#tab-monsecret .secret-entry-card textarea,
#tab-monsecret .secret-entry-card button {
  font: inherit;
}

#tab-monsecret .secret-entry-card input,
#tab-monsecret .secret-entry-card textarea {
  width: 100%;
  border: 1px solid rgba(217, 70, 239, 0.28);
  background: rgba(11, 7, 30, 0.88);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.72rem 0.82rem;
}

#tab-monsecret .secret-entry-card input::placeholder,
#tab-monsecret .secret-entry-card textarea::placeholder {
  color: #b7a2d4;
}

#tab-monsecret .secret-entry-card input:focus,
#tab-monsecret .secret-entry-card textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#tab-monsecret .secret-entry-card textarea {
  resize: vertical;
  min-height: 110px;
}

#tab-monsecret .secret-entry-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.76rem 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, #a855f7 0%, var(--accent) 100%);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(217, 70, 239, 0.3);
}

#tab-monsecret .secret-entry-btn:hover { filter: brightness(1.07); }
#tab-monsecret .secret-entry-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

#tab-monsecret .secret-entry-btn-secondary {
  background: rgba(148, 163, 184, 0.24);
  border: 1px solid rgba(203, 213, 225, 0.3);
  box-shadow: none;
}

#tab-monsecret .secret-entry-participant-space {
  display: grid;
  gap: 0.8rem;
}

#tab-monsecret #welcome-message,
#tab-monsecret #secret-form,
#tab-monsecret #secret-confirmation,
#tab-monsecret #logout-btn,
#tab-monsecret #participant-feedback {
  display: none;
}

#tab-monsecret #welcome-message:not([hidden]),
#tab-monsecret #secret-form:not([hidden]),
#tab-monsecret #secret-confirmation:not([hidden]),
#tab-monsecret #logout-btn:not([hidden]),
#tab-monsecret #participant-feedback:not([hidden]) {
  display: revert;
}

#tab-monsecret .secret-confirmation {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.4rem;
  margin: 0.4rem 0 0.2rem;
  padding: clamp(1rem, 4vw, 1.4rem);
  border-radius: 18px;
  border: 1px solid rgba(167, 139, 250, 0.55);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.26) 0%, rgba(124, 58, 237, 0.36) 100%);
  box-shadow: 0 14px 32px rgba(59, 130, 246, 0.22), inset 0 0 0 1px rgba(196, 181, 253, 0.25);
}

#tab-monsecret .secret-confirmation-icon,
#tab-monsecret .secret-confirmation-title,
#tab-monsecret .secret-confirmation-text,
#tab-monsecret .secret-entry-feedback,
#tab-monsecret .secret-entry-suggestions-title {
  margin: 0;
}

#tab-monsecret .secret-confirmation-icon { font-size: clamp(1.7rem, 7vw, 2.2rem); }
#tab-monsecret .secret-confirmation-title {
  font-size: clamp(1.2rem, 4.8vw, 1.55rem);
  font-weight: 900;
  color: #f5f3ff;
}

#tab-monsecret .secret-confirmation-text {
  color: #e9ddff;
  font-size: clamp(0.98rem, 3.9vw, 1.08rem);
  line-height: 1.55;
  max-width: 30ch;
}

#tab-monsecret .secret-entry-feedback {
  font-weight: 700;
  text-align: center;
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
}

#tab-monsecret .secret-entry-feedback.error {
  color: #fda4af;
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.45);
}

#tab-monsecret .secret-entry-suggestions {
  display: grid;
  gap: 0.7rem;
  justify-items: center;
  border-radius: 14px;
  padding: 0.75rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(120, 53, 15, 0.26);
}

#tab-monsecret .secret-entry-suggestions-title {
  font-size: 0.95rem;
  color: #fde68a;
  font-weight: 700;
}

#tab-monsecret .secret-entry-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

#tab-monsecret .secret-entry-suggestion-btn {
  border: 1px solid rgba(253, 224, 71, 0.5);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  color: #fef3c7;
  background: rgba(146, 64, 14, 0.6);
  font-weight: 700;
}

@keyframes monSecretShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

@media (max-width: 640px) {
  #tab-monsecret .secret-entry-card {
    border-radius: 18px;
    padding: 1rem;
    gap: 0.85rem;
  }

  #tab-monsecret .secret-entry-form-login {
    grid-template-columns: 1fr;
  }
}


#tab-monsecret .secret-entry-overwrite {
  display: grid;
  gap: 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(120, 53, 15, 0.22);
  padding: 0.8rem;
}

#tab-monsecret .secret-entry-overwrite[hidden] {
  display: none;
}

#tab-monsecret .secret-entry-overwrite-title {
  margin: 0;
  color: #fde68a;
  font-weight: 800;
  text-align: center;
}

#tab-monsecret #add-another-secret-btn {
  margin-top: 0.3rem;
}
