/* «Цель»: вид. Всё под .g-cel; общие токены — в shared/base.css. Акцент — терракотовый. */

.g-cel {
  --accent: #a63c18;          /* на белом 6,4:1, на фоне 5,8:1 */
  --on-accent: #ffffff;
  --accent-soft: #f6e3da;
  --star: #9a5b00;            /* на белом 5,4:1 */
  --star-off: #8a98a6;
  --scrim: rgba(12, 24, 36, 0.42);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 0;
  gap: 8px;
  overflow: hidden;
  color: var(--text);
}
:root[data-theme='dark'] .g-cel {
  --accent: #f4a47f;          /* на фоне 8,7:1, текст на нём #2a0e04 9:1 */
  --on-accent: #2a0e04;
  --accent-soft: #3a2a24;
  --star: #f0b43c;
  --star-off: #6a7d90;
  --scrim: rgba(0, 0, 0, 0.55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .g-cel {
    --accent: #f4a47f; --on-accent: #2a0e04; --accent-soft: #3a2a24;
    --star: #f0b43c; --star-off: #6a7d90; --scrim: rgba(0, 0, 0, 0.55);
  }
}

/* ---------- шапка и цель ---------- */

.g-cel .cel-target,
.g-cel .cel-msg,
.g-cel .cel-cards,
.g-cel .cel-ops { margin-inline: 16px; }

.g-cel .cel-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0 2px;
}
.g-cel .cel-tl { font-size: 15px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.g-cel .cel-tn {
  font-size: clamp(52px, 11vh, 76px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.g-cel .cel-msg {
  min-height: 20px;
  text-align: center;
  font-size: 15px;
  color: var(--text);
}
.g-cel .cel-msg.bad { font-weight: 600; }

/* ---------- карточки ---------- */

.g-cel .cel-cards {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 120px));
  align-content: center;
  gap: 10px;
  padding-top: 8px; /* место под приподнятую карточку */
}

.g-cel .cel-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 64px;
  border-radius: 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  box-shadow: 0 2px 6px var(--shadow);
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: transform 0.16s ease-out, border-color 0.16s, background 0.16s, box-shadow 0.16s, opacity 0.2s;
}
.g-cel .cel-card.l4 { font-size: 28px; }
.g-cel .cel-card.l5 { font-size: 23px; }
.g-cel .cel-card:active:not(.sel):not(:disabled) { transform: scale(0.97); }
.g-cel .cel-card.sel {
  transform: translateY(-8px);
  border-color: var(--accent);
  border-width: 2.5px;
  box-shadow: 0 10px 18px var(--shadow);
  background: var(--accent-soft);
}
.g-cel .cel-card.hint { outline: 3px solid var(--accent); outline-offset: 2px; animation: cel-hint 0.9s ease-in-out infinite alternate; }
.g-cel .cel-card.merging { transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.5); opacity: 0; }
.g-cel .cel-card.pop { animation: cel-pop 0.26s cubic-bezier(0.2, 1.4, 0.4, 1); }
.g-cel .cel-card.hit { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: scale(1.06); }
.g-cel .cel-card.shake { animation: cel-shake 0.28s; }

@keyframes cel-pop { from { transform: scale(0.55); opacity: 0.2; } to { transform: scale(1); opacity: 1; } }
@keyframes cel-hint { from { transform: scale(1); } to { transform: scale(1.04); } }
@keyframes cel-shake { 0%, 100% { translate: 0; } 25% { translate: -6px; } 75% { translate: 6px; } }

/* ---------- действия ---------- */

.g-cel .cel-ops {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.g-cel .cel-op {
  min-height: 58px;
  border-radius: 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.1s ease-out, background 0.15s, color 0.15s, border-color 0.15s;
}
.g-cel .cel-op:active:not(:disabled) { transform: scale(0.95); }
.g-cel .cel-op.sel { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.g-cel .cel-op.hint { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- карточка итога: общая (shared/card.js), здесь только то, что есть только в «Цели» ---------- */
.g-cel .cel-ov:empty { display: none; }
.g-cel .wday { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 600; color: var(--muted); text-align: left; }
.g-cel .wsol { margin-top: 10px; font-size: 15px; color: var(--text); display: grid; gap: 2px; }
.g-cel .wlist { margin-top: 6px; display: grid; gap: 4px; text-align: left; font-size: 16px; }
.g-cel .wlist div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.g-cel .wlist span:last-child { display: inline-flex; gap: 2px; }

/* маленькие экраны по высоте */
@media (max-height: 620px) {
  .g-cel { gap: 6px; }
  .g-cel .cel-card { min-height: 56px; font-size: 30px; }
  .g-cel .cel-op { min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .g-cel .cel-card, .g-cel .cel-op { transition: none; }
  .g-cel .cel-card.pop, .g-cel .cel-card.hint, .g-cel .cel-card.shake { animation: none; }
}
