:root {
  --bg-0: #0a0710;
  --bg-1: #160d20;
  --bg-2: #241330;
  --surface: rgba(27, 16, 38, 0.92);
  --surface-strong: rgba(35, 20, 49, 0.96);
  --panel-line: rgba(255, 255, 255, 0.06);
  --text: #f5ebff;
  --muted: #c5b8d8;
  --pink: #f77df6;
  --cyan: #33dcff;
  --lime: #c7ff54;
  --gold: #ffcf72;
  --shadow: 0 26px 54px rgba(0, 0, 0, 0.48);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { overflow-x: hidden; }

body {
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(circle at 18% 16%, rgba(247, 125, 246, 0.18), transparent 28%),
    radial-gradient(circle at 82% 10%, rgba(51, 220, 255, 0.15), transparent 30%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 52%, var(--bg-2) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
    repeating-linear-gradient(180deg, rgba(247, 125, 246, 0.045) 0 2px, transparent 2px 6px);
  opacity: 0.8;
}

.daily-shell {
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
}

.daily-card {
  width: min(900px, 100%);
  padding: clamp(18px, 3vw, 28px);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 16%),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.eyebrow,
.summary-label,
.field-label,
.section-title,
th {
  color: var(--cyan);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 0.92;
  color: var(--pink);
  letter-spacing: -0.05em;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  max-width: 42ch;
}

.daily-summary,
.daily-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.daily-summary {
  grid-template-columns: minmax(0, 1fr);
}

.summary-block,
.daily-player,
.daily-result,
.daily-board {
  border-radius: 16px;
  padding: 14px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 18%),
    var(--surface-strong);
  box-shadow: inset 0 0 0 1px var(--panel-line);
}

.summary-value {
  margin-top: 7px;
  font-size: 1.24rem;
  font-weight: 800;
  line-height: 1.1;
}

.daily-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.daily-result-copy {
  min-width: 0;
}

.daily-share-btn {
  flex: 0 0 auto;
  min-width: 84px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(51, 220, 255, 0.24);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(51, 220, 255, 0.22), rgba(51, 220, 255, 0.10));
  color: var(--cyan);
  font-family: "Space Grotesk", "Segoe UI", Tahoma, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.daily-share-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(51, 220, 255, 0.46);
  background: linear-gradient(180deg, rgba(51, 220, 255, 0.30), rgba(51, 220, 255, 0.14));
}

.daily-share-btn:active:not(:disabled) {
  transform: translateY(0);
}

.daily-share-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.daily-nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.daily-nav-wrapper .summary-value {
  margin-top: 0;
  flex-shrink: 0;
  min-width: 160px;
  text-align: center;
}

.daily-nav-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(51, 220, 255, 0.08);
  color: var(--cyan);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-appearance: none;
  appearance: none;
}

.daily-nav-btn:not(:disabled):hover {
  background: rgba(51, 220, 255, 0.16);
  border-color: rgba(51, 220, 255, 0.5);
  transform: scale(1.05);
}

.daily-nav-btn:not(:disabled):active {
  transform: scale(0.98);
  background: rgba(51, 220, 255, 0.24);
}

.daily-nav-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  background: rgba(51, 220, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

.summary-highlight .summary-value {
  color: var(--lime);
  font-size: 1.9rem;
}

.daily-player {
  display: grid;
  gap: 8px;
}

#daily-name-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(19, 11, 28, 0.95);
  color: var(--text);
}

.daily-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  min-height: 1.3em;
}

.daily-board-status {
  margin: 0 0 10px;
}

.daily-result.hidden {
  display: none;
}

.btn {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn-primary {
  color: #213100;
  background: linear-gradient(180deg, #d8ff75 0%, #b7f13d 100%);
}

.btn-secondary {
  color: #081a24;
  background: linear-gradient(180deg, #8fefff 0%, #53d7f6 100%);
}

.section-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.section-chip {
  min-height: 28px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(199, 255, 84, 0.14);
  color: var(--lime);
  font-size: 0.84rem;
  font-weight: 800;
}

.table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--panel-line);
  background: rgba(17, 11, 25, 0.88);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: rgba(22, 15, 31, 0.96);
}

td {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

tr.current-player td {
  background: rgba(199, 255, 84, 0.08);
}

td.score {
  color: var(--lime);
  font-weight: 800;
}

.crown-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.16em;
  margin-left: 0.34em;
  vertical-align: middle;
  user-select: none;
  -webkit-user-select: none;
}

.crown-icon {
  display: inline-block;
  font-size: 0.9em;
  line-height: 1;
  font-weight: 900;
  text-shadow: 0 0 7px rgba(0, 0, 0, 0.45);
}

.crown-blue {
  color: #55d6ff;
  text-shadow: 0 0 8px rgba(85, 214, 255, 0.38);
}

.crown-green {
  color: #8cff66;
  text-shadow: 0 0 8px rgba(140, 255, 102, 0.38);
}

.crown-red {
  color: #ff6894;
  text-shadow: 0 0 8px rgba(255, 104, 148, 0.36);
}

.crown-gold {
  color: #ffd25d;
  text-shadow: 0 0 8px rgba(255, 210, 93, 0.42);
}

@media (max-width: 640px) {
  .daily-shell {
    padding: 8px;
  }

  .daily-card {
    max-height: calc(100dvh - 16px);
    padding: 16px 14px;
    border-radius: 22px;
  }

  .daily-summary,
  .daily-actions {
    grid-template-columns: 1fr;
  }

  .daily-share-btn {
    min-width: 76px;
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
  }

  .table-wrap {
    overflow-x: hidden;
  }

  table {
    table-layout: fixed;
  }

  thead {
    display: table-header-group;
  }

  th,
  td {
    display: table-cell;
    border: 0;
    padding: 10px 8px;
    vertical-align: middle;
  }

  th {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    background: rgba(22, 15, 31, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 18%;
    text-align: center;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 57%;
    text-align: left;
  }

  th:nth-child(3),
  td:nth-child(3) {
    width: 25%;
    text-align: right;
  }

  tbody tr {
    background: rgba(255, 255, 255, 0.015);
  }

  tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
  }

  tbody td:nth-child(1) {
    font-weight: 800;
    color: #f0e8ff;
  }

  tbody td:nth-child(2) {
    font-size: 0.98rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  tbody td.score {
    font-size: 1.1rem;
    font-weight: 900;
  }

  .crown-badges {
    margin-left: 0.22em;
    gap: 0.12em;
  }

  .crown-icon {
    font-size: 0.82em;
  }
}
