.attack-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: start;
}

.attack-layout > .wheel-side { min-width: 0; }
.attack-page .wheel-heading { margin-bottom: 18px; }
.attack-page h1 { margin: 6px 0 8px; font-size: clamp(28px, 3vw, 36px); }
.attack-page .wheel-heading p { margin: 0; }

.attack-field {
  --field-green: #91edb3;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr) auto;
  height: auto;
  min-height: max(490px, calc(var(--line-count, 5) * 90px + 150px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #102d25;
  color: #eefaf2;
  box-shadow: 0 10px 30px var(--shadow);
}

.attack-field .attack-field-image {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: none;
  pointer-events: none;
  user-select: none;
}

.attack-field::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #03171130, transparent 35%, #03171118);
  pointer-events: none;
}

.attack-goal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 90px;
  padding: 12px 16px;
  text-align: center;
  text-shadow: 0 2px 14px #061e16;
}
.attack-goal span { font-size: clamp(7px, .75vw, 10px); font-weight: 650; letter-spacing: .08em; }
.attack-goal strong { max-width: 80%; font-size: clamp(22px, 2.5vw, 30px); line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--field-green); }
.attack-field[data-status='won'] .attack-goal strong,
.attack-field[data-status='cashed_out'] .attack-goal strong { text-shadow: 0 0 24px #70dda580; }

#attack-lines { display: flex; flex-direction: column-reverse; padding: 0 24px; min-height: 0; }
/* Подписи занимают ширину строки; длинный текст увеличивает высоту поля. */
.attack-row { display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 6px; flex: 1; min-height: min-content; padding: 8px 0; border-bottom: 1px dashed #c2efda26; }
.attack-row:last-child { border-top: 1px dashed #c2efda26; }
.attack-row header { display: grid; grid-template-columns: minmax(50px, .7fr) minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.attack-row header span { font-size: 10px; color: #d7e7df; }
.attack-row header strong { font-size: 18px; line-height: 1.1; color: var(--field-green); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.attack-row header small { text-align: right; font-size: 9px; color: #a9c2b6; }
.attack-row header strong { text-align: center; }
.attack-row header strong.custom-label { font-size: 13px; line-height: 1.3; }
.attack-goal strong.custom-label { font-size: 16px; line-height: 1.3; }
.attack-row.current header span { color: var(--field-green); }
.attack-directions { display: flex; justify-content: center; gap: 10px; min-width: 0; }
.attack-directions button {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1;
  min-width: 0;
  max-width: 78px;
  height: 46px;
  padding: 0;
  border: 1px solid #c0f2da33;
  border-radius: 12px;
  background: #102d2d99;
  color: #abc5b9;
  box-shadow: inset 0 1px 0 #ffffff05;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.attack-direction-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.attack-directions button:disabled { cursor: default; color: #78958a; }
.attack-row.current .attack-directions button { border-color: #91edb373; color: #d3f4e0; background: #1d483dc9; }
.attack-directions button:not(:disabled):hover { border-color: var(--field-green); background: #2b644c; box-shadow: 0 0 16px #70dda51f; }
.attack-directions button:focus-visible { outline: 2px solid #e8fff0; outline-offset: 4px; }
.attack-directions button.selected { background: linear-gradient(145deg, #35865a, #21633f); border-color: #93efb4; color: #f0fff5; box-shadow: inset 0 1px 0 #d1ffdc33, 0 0 18px #69db8e30; }
.attack-directions button.lost { background: linear-gradient(145deg, #9a424b, #702c39); border-color: #ff9b9f; color: #ffe6e6; box-shadow: 0 0 18px #e66a7833; }
.attack-directions button.has-ball .attack-direction-icon { opacity: 0; }

.attack-start { min-height: 75px; padding: 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.attack-kickoff { width: 66px; height: 26px; border: 1px solid #91edb380; border-radius: 50%; background: #70dda515; box-shadow: 0 0 24px #70dda51a; }
#attack-field-status { max-width: 90%; padding: 7px 14px; border: 1px solid #b9e5ce26; border-radius: 30px; background: #0b2925bd; color: #cae9d8; font-size: 10px; font-weight: 650; letter-spacing: .1em; text-align: center; }
.attack-field[data-status='lost'] #attack-field-status { color: #ffb0b4; }
.attack-ball { position: absolute; z-index: 2; top: 0; left: 0; width: 44px; height: 44px; pointer-events: none; visibility: hidden; filter: drop-shadow(0 5px 5px #001a15a6); will-change: transform; }
.attack-ball.is-positioned { visibility: visible; }
.attack-field .attack-ball img { display: block; width: 100%; height: 100%; object-fit: contain; filter: none; }
.attack-ball[data-status='lost'] { filter: drop-shadow(0 0 8px #ff6970a6); }

form.attack-controls { max-width: none; gap: 13px; }
.attack-controls .crash-presets button[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.attack-controls .crash-presets button:disabled { cursor: default; opacity: .55; }
.attack-controls label { margin-top: 10px; font-size: 13px; }
body form.attack-controls #attack-stake { padding: 14px; font-size: 22px; font-weight: 650; }
.attack-stats { margin: 8px 0 2px; padding: 16px; border-radius: 14px; background: var(--accent-soft); }
.attack-stats > div { min-width: 0; }
.attack-stats strong { display: block; overflow-wrap: anywhere; color: var(--accent); font-size: 23px; }
.attack-stats strong.custom-label { font-size: 15px; line-height: 1.3; }
.attack-controls #attack-message { min-height: 20px; }
.attack-controls #attack-message:not(:empty) { padding: 12px; border-radius: 12px; background: var(--accent-soft); }
.attack-refresh { border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.attack-refresh[hidden], .attack-controls [hidden] { display: none; }
.attack-rules { margin: 0; }

.attack-history h2 { margin-bottom: 16px; }
#attack-history { display: grid; gap: 8px; }
.attack-history-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 1fr 1fr; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 13px; }
.attack-history-row > span { display: grid; gap: 3px; min-width: 0; }
.attack-history-row small { color: var(--text-muted); font-size: 11px; }
.attack-history-row strong { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.attack-history-result { display: inline-flex; justify-self: start; padding: 5px 9px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.attack-history-result[data-status='lost'] { background: #ef44441a; color: #d64848; }
.attack-history-empty { margin: 0; font-size: 13px; }

@media (max-width: 850px) {
  .attack-layout { grid-template-columns: 1fr; }
  .attack-page .crash-heading-actions { align-items: flex-start; }
}

@media (max-width: 600px) {
  .attack-field { min-height: max(470px, calc(var(--line-count, 5) * 86px + 150px)); }
  #attack-lines { padding: 0 12px; }
  .attack-row { gap: 6px; }
  .attack-row header strong { font-size: 17px; }
  .attack-row header span, .attack-row header small { font-size: 9px; }
  .attack-directions { gap: 6px; }
  .attack-directions button { height: 46px; border-radius: 9px; }
  .attack-direction-icon { width: 18px; height: 18px; }
  .attack-ball { width: 32px; height: 32px; }
  .attack-goal span { font-size: 7px; letter-spacing: .02em; }
  .attack-goal strong { font-size: 24px; }
  #attack-field-status { font-size: 8px; }
  .attack-kickoff { width: 50px; height: 20px; }
  .attack-history-row { grid-template-columns: 1fr 1fr; }
  .attack-history-result { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .attack-directions button { transition: none; }
}
