*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  --bg:     #100e07;
  --bg2:    #1a1609;
  --bg3:    #251c0d;
  --border: #3d2d10;
  --text:   #f5ead8;
  --text2:  #b89060;
  --text3:  #6b5030;
  --accent: #EF9F27;
  --accent2:#f5bc5e;
  --green:  #2aaa70;
  --red:    #cc4422;
  --yellow: #EF9F27;

  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

/* ====== SCREENS ====== */

.screen {
  display: none;
  min-height: calc(100vh - 56px);
}

.screen.active {
  display: flex;
  animation: fadeIn .22s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen-inner {
  margin: auto;
  width: 100%;
  max-width: 900px;
  padding: 2rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.3rem;
  text-align: center;
}

/* ====== BUTTONS ====== */

.cta-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .65rem 2rem;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  width: auto;
  min-width: 180px;
  align-self: center;
}
.cta-btn:hover  { opacity: .88; }
.cta-btn:active { transform: scale(.98); }
.cta-btn:disabled { opacity: .35; cursor: default; }

.cta-outline {
  display: inline-block;
  background: transparent;
  color: var(--text2);
  border: 1.5px solid var(--border);
  padding: .6rem 1.75rem;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  width: auto;
  min-width: 160px;
  text-align: center;
  text-decoration: none;
}
.cta-outline:hover { border-color: var(--text3); color: var(--text); }

.back-link {
  color: var(--text3);
  text-decoration: none;
  font-size: 13px;
  transition: color .15s;
}
.back-link:hover { color: var(--text2); }

/* ====== WELCOME ====== */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding-top: .5rem;
}

.hero-icon {
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 4px 20px rgba(239,159,39,.45));
}

.hero-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
}

.hero-sub {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  max-width: 290px;
}

.daily-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  text-align: left;
}

.daily-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--accent2);
  background: rgba(239,159,39,.14);
  padding: 3px 9px;
  border-radius: 6px;
}

.daily-date { font-size: 12px; color: var(--text3); }

.hint-text { font-size: 13px; color: var(--text2); line-height: 1.55; }

.daily-done { display: flex; flex-direction: column; gap: 3px; }
.daily-done-score { font-size: 19px; font-weight: 700; color: var(--accent2); }
.daily-done-sub   { font-size: 12px; color: var(--green); }

.how-it-works {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  text-align: left;
}

.how-row {
  font-size: 13px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ====== LOADING ====== */

.loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loader-icon {
  font-size: 52px;
  animation: breathe 1.8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .45; transform: scale(.92); }
}

.loader-text  { font-size: 14px; color: var(--text2); }

.loader-track {
  width: 180px;
  height: 3px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
}

.loader-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  width: 0;
  transition: width .3s ease;
}

.loader-count { font-size: 12px; color: var(--text3); }

/* ====== GAME SCREEN ====== */

.game-top { width: 100%; }

.game-instruction {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  text-align: left;
}

/* ====== GAME CARDS — horizontal timeline ====== */

.timeline-list {
  width: 100%;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  position: relative;
  padding-bottom: 30px;
}

/* The horizontal line — center at 15px below card bottom */
.timeline-list::before {
  content: '';
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  pointer-events: none;
}

.tl-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  position: relative;
  user-select: none;
  cursor: grab;
  transition: border-color .15s, box-shadow .15s;
}
.tl-card:active { cursor: grabbing; }

/* Dot centered on the timeline line */
.tl-card::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 10px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  z-index: 1;
  pointer-events: none;
}

.tl-ghost {
  opacity: .4;
  background: var(--bg3);
}
.tl-ghost::after { background: var(--border); }

.tl-drag {
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
  border-color: var(--accent) !important;
}

.tl-img-wrap {
  position: relative;
  width: 100%;
  height: 210px;
  background: var(--bg3);
  overflow: hidden;
  border-radius: 13px 13px 0 0;
}

.tl-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tl-pos-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-card-footer {
  padding: .6rem .75rem;
}

.tl-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, serif;
  font-style: italic;
}

.tl-artist {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ====== RESULT SCREEN ====== */

.result-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding-top: .5rem;
}

.result-icon  { font-size: 48px; line-height: 1; }

.result-score {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--accent2);
  line-height: 1;
  animation: scorePop .45s cubic-bezier(.34,1.56,.64,1);
}

@keyframes scorePop {
  from { transform: scale(.5); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

.result-max    { font-size: 18px; color: var(--text3); font-weight: 600; }
.result-rating { font-size: 16px; font-weight: 700; color: var(--text2); margin-top: .4rem; }

.result-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  width: 100%;
  text-align: left;
}

.result-cards {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* ====== RESULT CARDS — horizontal list ====== */

.result-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.result-card.correct { border-color: var(--green); }
.result-card.wrong   { border-color: var(--red); }

.result-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg3);
}

.result-info {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.result-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Georgia, serif;
  font-style: italic;
}

.result-placed {
  font-size: 11px;
  margin-top: 2px;
}
.result-card.correct .result-placed { color: var(--green); }
.result-card.wrong   .result-placed { color: var(--red); }

.result-right {
  text-align: right;
  flex-shrink: 0;
}

.result-pos {
  font-size: 15px;
  font-weight: 700;
  color: var(--text2);
}

.tl-date {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}
.result-card.correct .tl-date { color: var(--green); }

.final-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
