/* ==========================================================================
   Tango — "Day / Night" celestial aesthetic
   Game widget + /play-tango & /tango-answer-today page styles.
   ========================================================================== */

:root {
  --t-ink: #141a31;          /* midnight base            */
  --t-ink-2: #1d2342;        /* panel surface            */
  --t-ink-3: #2b3258;        /* raised / borders         */
  --t-gold: #f3b13c;         /* sun                      */
  --t-gold-2: #ffd27a;       /* sun highlight            */
  --t-silver: #c2cce4;       /* moon light               */
  --t-moon: #36406e;         /* moon fill on light cell  */
  --t-cream: #f1ecdf;        /* text on dark             */
  --t-muted: #9aa4c4;        /* muted on dark            */
  --t-cell: #fbf7ee;         /* light puzzle cell        */
  --t-line: rgba(241,236,223,0.13);
  --t-danger: #e35666;
  --t-radius: 16px;
  --gut: 22px;
  --t-display: 'Fraunces', Georgia, serif;
}

/* ---- Page hero / sections (light page) ---------------------------------- */

.tango-page { max-width: 980px; margin: 0 auto; padding: 20px 16px 56px; }

.tango-hero { text-align: center; margin: 8px 0 24px; }
.tango-hero .t-eyebrow {
  font: 600 0.78rem/1 var(--t-display); letter-spacing: 0.22em; text-transform: uppercase;
  color: #b07d1e; margin-bottom: 12px;
}
.tango-hero h1 {
  font: 600 clamp(2rem, 5vw, 3rem)/1.05 var(--t-display);
  color: var(--t-ink); margin: 0 0 10px; letter-spacing: -0.01em;
}
.tango-hero h1 em { font-style: italic; color: #b07d1e; }
.tango-hero p { color: #54597a; max-width: 60ch; margin: 0 auto; font-size: 1.05rem; }

/* ---- Game panel (dark, celestial) --------------------------------------- */

.t-game {
  background:
    radial-gradient(130% 90% at 80% -10%, #2c3766 0%, var(--t-ink-2) 55%, var(--t-ink) 100%);
  border: 1px solid var(--t-ink-3);
  border-radius: var(--t-radius);
  padding: 18px 18px 22px;
  box-shadow: 0 24px 60px -28px rgba(8,10,24,0.8), inset 0 1px 0 rgba(255,255,255,0.05);
  color: var(--t-cream);
  position: relative; overflow: hidden;
}
/* faint starfield */
.t-game::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px at 55% 45%, rgba(255,255,255,0.3), transparent);
}

.t-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; position: relative; z-index: 1; }
.t-diff-group { display: flex; gap: 6px; }
.t-diff-btn {
  font: 600 0.88rem/1 system-ui, sans-serif; color: var(--t-muted);
  background: rgba(255,255,255,0.04); border: 1px solid var(--t-line);
  border-radius: 9px; padding: 8px 13px; cursor: pointer; transition: all 0.15s ease;
}
.t-diff-btn:hover { color: var(--t-cream); border-color: rgba(243,177,60,0.5); }
.t-diff-btn.is-active {
  color: var(--t-ink); background: linear-gradient(180deg, var(--t-gold-2), var(--t-gold));
  border-color: var(--t-gold-2);
}
.t-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.t-btn {
  font: 600 0.9rem/1 system-ui, sans-serif; color: var(--t-cream);
  background: rgba(255,255,255,0.05); border: 1px solid var(--t-line);
  border-radius: 10px; padding: 10px 14px; cursor: pointer; transition: all 0.15s ease;
}
.t-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(243,177,60,0.5); transform: translateY(-1px); }
.t-btn-primary { color: var(--t-ink); background: linear-gradient(180deg, var(--t-gold-2), var(--t-gold)); border-color: var(--t-gold-2); }
.t-btn-primary:hover { filter: brightness(1.05); }

.t-statusbar { display: flex; gap: 10px; margin-bottom: 14px; position: relative; z-index: 1; }
.t-chip {
  font: 600 0.85rem/1 system-ui, sans-serif; padding: 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--t-line);
}
.t-timer { font-variant-numeric: tabular-nums; min-width: 56px; text-align: center; }

/* ---- Board -------------------------------------------------------------- */

.t-board-wrap { position: relative; display: flex; justify-content: center; z-index: 1; }
.t-board {
  display: grid;
  width: min(100%, 460px);
  padding: 10px; border-radius: 14px;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 1px var(--t-line);
}

.t-cell {
  aspect-ratio: 1 / 1;
  background: var(--t-cell);
  border: 0; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.06);
  transition: transform 0.08s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.t-cell:hover:not(.is-given) { box-shadow: inset 0 0 0 2px var(--t-gold); }
.t-cell:active:not(.is-given) { transform: scale(0.94); }
.t-cell:focus-visible { outline: 3px solid var(--t-gold); outline-offset: 2px; }
.t-cell.is-given { background: #ece6d8; cursor: default; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.t-cell.is-conflict { background: #fde1e4; box-shadow: inset 0 0 0 2px var(--t-danger); }

.t-mark { width: 72%; height: 72%; display: flex; align-items: center; justify-content: center; }
.t-sym { width: 100%; height: 100%; }
.t-sun { color: var(--t-gold); fill: var(--t-gold); }
.t-sun circle { fill: var(--t-gold); }
.t-sun .t-rays { stroke: var(--t-gold); stroke-width: 2.1; stroke-linecap: round; }
.t-moon { fill: var(--t-moon); }
.t-cell.is-given .t-sun, .t-cell.is-given .t-sun circle { color: #d99a1e; fill: #d99a1e; }
.t-cell.is-given .t-sun .t-rays { stroke: #d99a1e; }
.t-cell.is-given .t-moon { fill: #2a3358; }

.t-mark.is-won { animation: t-pop 0.4s cubic-bezier(.2,1.5,.4,1) backwards; animation-delay: var(--win-delay, 0ms); }
.t-cell.is-hint { animation: t-hint 0.7s ease-in-out 3; }

/* sign gutters */
.t-gut { display: flex; align-items: center; justify-content: center; }
.t-sign {
  font: 700 0.95rem/1 var(--t-display); color: var(--t-cream);
  background: rgba(255,255,255,0.12); border: 1px solid var(--t-line);
  width: 18px; height: 18px; border-radius: 5px; display: flex; align-items: center; justify-content: center;
}

@keyframes t-pop { 0% { transform: scale(0.2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes t-hint { 0%,100% { box-shadow: inset 0 0 0 2px var(--t-gold); } 50% { box-shadow: inset 0 0 0 4px var(--t-gold), 0 0 14px var(--t-gold); } }

/* ---- Win overlay -------------------------------------------------------- */

.t-win { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(10,12,28,0.74); backdrop-filter: blur(4px); }
.t-win[hidden] { display: none; }
.t-win-card { background: linear-gradient(180deg, var(--t-ink-3), var(--t-ink-2)); border: 1px solid rgba(243,177,60,0.4); border-radius: 16px; padding: 26px 28px; text-align: center; max-width: 340px; box-shadow: 0 30px 70px -25px rgba(0,0,0,0.85); }
.t-win-faces { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.t-win-faces .t-sym { width: 38px; height: 38px; }
.t-win-card h3 { font: 600 1.8rem/1 var(--t-display); color: var(--t-cream); margin: 0 0 6px; }
.t-win-sub { color: var(--t-muted); font-size: 0.95rem; margin: 0 0 18px; }
.t-win-actions { display: flex; gap: 10px; justify-content: center; }
.t-win-copied { color: #7fe0a8; font-size: 0.85rem; margin: 12px 0 0; }

.t-msg { text-align: center; color: var(--t-muted); min-height: 1.2em; margin: 12px 0 4px; position: relative; z-index: 1; font-size: 0.92rem; }
.t-statsbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--t-line); color: var(--t-muted); font-size: 0.85rem; position: relative; z-index: 1; }
.t-statsbar b { color: var(--t-gold-2); }

/* ---- Content sections (shared by both Tango pages) ---------------------- */

.tango-section { margin: 40px 0 0; }
.tango-section h2 { font: 600 1.6rem/1.2 var(--t-display); color: var(--t-ink); margin: 0 0 14px; }
.tango-section h3 { font: 600 1.15rem/1.3 var(--t-display); color: var(--t-ink); margin: 22px 0 8px; }
.tango-section p, .tango-section li { color: #44485f; font-size: 1.02rem; line-height: 1.7; }
.tango-section ul, .tango-section ol { padding-left: 1.25em; margin: 10px 0; }
.tango-section li { margin: 6px 0; }

.t-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 18px 0; }
.t-rule-card { background: #fff; border: 1px solid #e7e9f2; border-left: 4px solid var(--t-gold); border-radius: 12px; padding: 16px 18px; box-shadow: 0 4px 14px -10px rgba(20,26,49,0.4); }
.t-rule-card .t-rule-n { font: 700 0.78rem/1 system-ui; color: #b07d1e; letter-spacing: 0.08em; }
.t-rule-card h4 { margin: 8px 0 4px; font-size: 1.02rem; color: var(--t-ink); }
.t-rule-card p { font-size: 0.92rem; color: #5a5f78; margin: 0; }

.t-faq details { background: #fff; border: 1px solid #e7e9f2; border-radius: 12px; padding: 4px 18px; margin: 10px 0; }
.t-faq details[open] { box-shadow: 0 8px 22px -14px rgba(20,26,49,0.5); }
.t-faq summary { cursor: pointer; list-style: none; padding: 14px 0; font: 600 1.02rem/1.4 system-ui, sans-serif; color: var(--t-ink); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.t-faq summary::-webkit-details-marker { display: none; }
.t-faq summary::after { content: "+"; font: 400 1.4rem/1 var(--t-display); color: var(--t-gold); }
.t-faq details[open] summary::after { content: "–"; }
.t-faq details p { margin: 0 0 14px; }

.tango-cross { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.tango-cross a { display: block; text-align: center; padding: 14px 10px; border-radius: 11px; background: #fff; border: 1px solid #e7e9f2; color: var(--t-ink); font-weight: 600; text-decoration: none; transition: all 0.15s ease; }
.tango-cross a:hover { border-color: var(--t-gold); transform: translateY(-2px); box-shadow: 0 8px 20px -12px rgba(20,26,49,0.5); }

/* ==========================================================================
   /tango-answer-today  (answer & hints page)
   ========================================================================== */

.ta-puzzle-num { display: inline-block; margin-top: 8px; font: 600 0.95rem/1 system-ui, sans-serif; color: #b07d1e; background: #fbf3e1; border: 1px solid #f0e0bd; padding: 6px 13px; border-radius: 999px; }

.ta-answerbox { background: linear-gradient(180deg, #fffdf8, #fff); border: 1px solid #ece6d6; border-radius: 16px; padding: 22px; box-shadow: 0 14px 36px -24px rgba(20,26,49,0.5); margin: 8px 0 26px; }
.ta-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.ta-tag { font: 600 0.82rem/1 system-ui; padding: 7px 12px; border-radius: 999px; background: #f1eee7; color: #5f5a48; border: 1px solid #e7ddc9; }
.ta-tag b { color: var(--t-ink); }
.ta-tag.is-diff { background: #fbf0e3; color: #9a6a2e; border-color: #f0d9bd; }
.ta-firstmove { color: #54597a; font-size: 0.98rem; margin: 0 0 18px; }
.ta-firstmove strong { color: var(--t-ink); }

.ta-reveal { text-align: center; }
.ta-reveal-btn { font: 600 1rem/1 system-ui; cursor: pointer; color: var(--t-ink); background: linear-gradient(180deg, var(--t-gold-2), var(--t-gold)); border: 0; border-radius: 12px; padding: 13px 22px; box-shadow: 0 6px 18px -8px rgba(243,177,60,0.7); }
.ta-reveal-btn:hover { filter: brightness(1.05); }
.ta-reveal-btn small { display: block; font-weight: 500; font-size: 0.72rem; color: #6b4e12; margin-top: 3px; }
.ta-hidden { display: none; }

.ta-solution { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 22px; align-items: start; }
@media (max-width: 600px) { .ta-solution { grid-template-columns: 1fr; } }

.ta-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; width: 100%; max-width: 320px; margin: 0 auto; padding: 10px; background: var(--t-ink-2); border-radius: 12px; }
.ta-grid .ta-cell { aspect-ratio: 1/1; background: var(--t-cell); border-radius: 7px; display: flex; align-items: center; justify-content: center; }
.ta-grid .ta-cell .t-sym { width: 70%; height: 70%; }

.ta-copybox h3 { font: 600 1.05rem/1.3 var(--t-display); color: var(--t-ink); margin: 0 0 10px; }
.ta-emoji { font-size: 1.35rem; line-height: 1.35; letter-spacing: 2px; margin: 0 0 12px; user-select: all; }
.ta-rowtext { list-style: none; padding: 0; margin: 0 0 14px; }
.ta-rowtext li { font: 600 0.86rem/1.5 ui-monospace, Menlo, monospace; color: #44485f; }
.ta-rowtext b { color: #b07d1e; }
.ta-copy { font: 600 0.85rem/1 system-ui; cursor: pointer; color: var(--t-ink); background: #fff; border: 1px solid #e3dcc4; border-radius: 9px; padding: 9px 14px; }
.ta-copy:hover { border-color: var(--t-gold); }
.ta-copied { color: #2e9e6b; font-size: 0.82rem; margin-left: 8px; }

.ta-hints { display: grid; gap: 10px; margin-top: 6px; }
.ta-hint { background: #fff; border: 1px solid #e7e9f2; border-radius: 12px; overflow: hidden; }
.ta-hint-btn { width: 100%; text-align: left; cursor: pointer; background: none; border: 0; padding: 15px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 600 1rem/1.3 system-ui; color: var(--t-ink); }
.ta-hint-btn:hover { background: #faf8f2; }
.ta-hint-btn .ta-hint-cue { font: 500 0.82rem/1 system-ui; color: var(--t-gold); }
.ta-hint-body { padding: 0 18px 16px; color: #4a4e63; line-height: 1.6; }

.ta-yesterday { background: #f4f5fa; border: 1px dashed #d6daea; border-radius: 12px; padding: 16px 18px; margin-top: 22px; }
.ta-yesterday h3 { font: 600 1.05rem/1 var(--t-display); color: var(--t-ink); margin: 0 0 6px; }
.ta-yesterday p { margin: 0; color: #54597a; font-size: 0.95rem; }
.ta-yesterday a { color: #b07d1e; font-weight: 600; text-decoration: none; }

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 560px) {
  .t-game { padding: 14px 12px 18px; }
  :root { --gut: 16px; }
  .t-actions { width: 100%; } .t-actions .t-btn { flex: 1; padding: 10px 6px; }
  .t-sign { width: 15px; height: 15px; font-size: 0.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .t-mark.is-won, .t-cell.is-hint { animation: none !important; }
}
