.future-game.match-entry { border-color: #676697; background: linear-gradient(110deg, #332650, #162440); }
.match-entry:hover { border-color: var(--pink); }
.match-entry img { grid-row: span 2; justify-self: center; width: 35px; height: 35px; object-fit: contain; }

.match-shell { max-width: min(1010px, max(802px, calc(100dvh + 70px))); }
.match-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.match-heading h1 { margin-bottom: 0; }
.match-hud { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.match-stat { display: flex; align-items: center; gap: 9px; min-width: 124px; padding: 8px 11px; border: 1px solid #536184; border-radius: 8px; background: linear-gradient(125deg, #1d2852, #151b31); }
.match-stat > .icon { width: 24px; height: 24px; color: var(--blue); }
.match-stat dt { color: #c1cbea; font-size: .79rem; }
.match-stat dd { color: var(--paper); font: bold 1.45rem/1.1 var(--serif); font-variant-numeric: tabular-nums; white-space: nowrap; }
.match-score { border-color: #674b75; background: linear-gradient(125deg, #372447, #201933); }
.match-score > .icon { color: var(--gold); }
.match-clock.urgent dd, .match-clock.urgent > .icon { color: #ffb3af; }

.match-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); grid-template-areas: "field round" "field tools" "field leaders"; grid-template-rows: auto auto 1fr; gap: 12px; align-items: start; }
.match-panel { min-width: 0; padding: 14px; border: 1px solid #4b4265; border-radius: 10px; background: linear-gradient(145deg, #191f38, #21172e); box-shadow: 0 8px 25px #07091466; }
.match-panel h2 { font: bold 1.28rem/1.13 var(--serif); }
.match-field { grid-area: field; padding: 8px 8px 0; background: linear-gradient(145deg, #23294c, #2c1f3a 75%); }
.match-board { position: relative; overflow: hidden; border: 1px solid #65618b; border-radius: 7px; background: #0e1328; }
.match-grid { position: relative; width: 100%; aspect-ratio: 1; display: grid; gap: clamp(2px, .34vw, 5px); padding: clamp(3px, .5vw, 6px); grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); touch-action: none; user-select: none; }
.match-cell { --tile-tint: #6b9cf566; position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 8%; appearance: none; border: 1px solid color-mix(in srgb, var(--tile-tint) 80%, #33405c); border-radius: 7px; background: radial-gradient(ellipse at 40% 24%, var(--tile-tint), #161d38 97%); -webkit-tap-highlight-color: transparent; }
.match-cell[data-color="1"] { --tile-tint: #ab557e6e; }
.match-cell[data-color="2"] { --tile-tint: #a365366a; }
.match-cell[data-color="3"] { --tile-tint: #8d5ac370; }
.match-cell[data-color="4"] { --tile-tint: #477f706c; }
.match-cell[data-color="5"] { --tile-tint: #a0886266; }
.match-cell[aria-pressed="true"] { z-index: 1; border-color: #ffe2b3; box-shadow: inset 0 0 10px #f7bd8755, 0 0 0 1px #ffe2b3; }
.match-cell:focus-visible { z-index: 2; outline-offset: -2px; }
.match-cell:hover { border-color: #c5b2e8; }
.flower-glyph { width: 100%; height: 100%; display: block; pointer-events: none; }
.flower-glyph::before { content: ""; width: 100%; height: 100%; display: block; background: var(--flower-image) center / contain no-repeat; filter: drop-shadow(0 2px 3px #090e20d6); }
.match-cell[data-power="column"] .flower-glyph::before { transform: rotate(90deg); }
.match-cell[data-power="row"], .match-cell[data-power="column"] { border-color: #9abaff; box-shadow: inset 0 0 10px #6b9cf54d; }
.match-cell[data-power="potion"] { border-color: #f2a4ce; box-shadow: inset 0 0 10px #e37fa85e; }
.match-cell[data-power]:not([data-power="flower"])::after { content: ""; position: absolute; right: 7%; bottom: 7%; width: 11%; aspect-ratio: 1; border-radius: 50%; border: 1px solid #e8e4f595; background: var(--tile-tint); pointer-events: none; }
.match-cell.clearing .flower-glyph, .match-cell.blasting .flower-glyph { animation: flower-pop 100ms ease-in forwards; }
.match-cell.blasting { background: radial-gradient(ellipse at center, #dcb4e8, var(--tile-tint)); }
@keyframes flower-pop { to { opacity: 0; transform: scale(1.38); } }
.match-curtain { position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; background: #0f1226a6; backdrop-filter: blur(12px); }
.match-curtain span { border: 1px solid #ae97c7; border-radius: 8px; padding: .6em 1.3em; background: #1a203a; font: bold 1.65rem var(--serif); }
.match-status { min-height: 2.8em; padding: 9px 5px; color: #e0d9eb; font-size: .86rem; }

.match-round { grid-area: round; display: grid; gap: 10px; }
.match-player { display: grid; gap: 4px; }
.match-player label { color: #ded8eb; font-size: .83rem; font-weight: 650; }
.match-player input { width: 100%; min-width: 0; min-height: 36px; border-radius: 6px; border: 1px solid #5b557a; padding: 7px 9px; background: #10172b; color: var(--paper); font: inherit; }
.match-player input::placeholder { color: #a4a7c7; }
.match-player:has(input:disabled) { display: none; }
.match-actions { display: flex; align-items: stretch; gap: 7px; }
.match-tools { grid-area: tools; }
.match-bonuses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 11px 0; }
.match-bonuses > div { background: #131b31; border: 1px solid #484968; border-radius: 6px; padding: 5px 2px; text-align: center; }
.match-bonuses dt { color: #c6cbea; font-size: .73rem; }
.match-bonuses dd { color: #e5ceff; font-size: .95rem; font-weight: 750; }
.match-power-guide { display: grid; gap: 7px; list-style: none; padding: 0; margin: 0; }
.match-power-guide li { display: grid; grid-template-columns: 35px 1fr; gap: 7px; align-items: center; }
.match-power-guide img { width: 35px; height: 35px; object-fit: contain; }
.match-power-guide strong { display: block; color: var(--paper); font-size: .88rem; }
.match-help, .match-power-guide span, .match-leaders > p { color: #c2c1db; font-size: .8rem; line-height: 1.35; }
.match-help { margin-top: 9px; padding-top: 8px; border-top: 1px solid #4b4265; }
.match-leaders { grid-area: leaders; }
.match-leaders > p { margin: 6px 0 10px; }
.match-leaders table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .85rem; }
.match-leaders th, .match-leaders td { padding: 6px 4px; border-bottom: 1px solid #4b4265; overflow-wrap: anywhere; text-align: left; }
.match-leaders th { font-size: .75rem; color: #c2c1db; }
.match-leaders th:first-child { width: 4.1em; white-space: nowrap; }
.match-leaders th:last-child { width: 5.3em; }
.match-leaders th:last-child, .match-leaders td:nth-child(3) { text-align: right; }
.match-leaders td[colspan] { color: #c2c1db; }
.match-last-record { color: #f9d99d; background: #e7c48816; }
.match-modal > .icon { width: 50px; height: 50px; color: var(--gold); }
.match-modal #match-result-score { margin-bottom: 6px; color: #f5dcad; font-size: 1.2rem; font-weight: 750; }

@media (max-width: 740px) {
  .match-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "round" "field" "tools" "leaders"; grid-template-rows: auto; gap: 8px; }
  .match-round { grid-template-columns: minmax(0, 1fr) minmax(122px, 1fr); align-items: end; padding: 8px; }
  .match-round:has(input:disabled) { grid-template-columns: 1fr; }
  .match-heading { margin-bottom: 9px; }
  .match-field { padding: 4px 4px 0; }
}

@media (max-width: 500px) {
  .match-heading { align-items: center; }
  .match-hud { gap: 4px; }
  .match-stat { min-width: 70px; padding: 5px 6px; gap: 4px; }
  .match-stat > .icon { width: 16px; height: 16px; }
  .match-stat dd { font-size: 1.04rem; }
  .match-stat dt { font-size: .69rem; }
  .match-cell { border-radius: 4px; }
  .match-entry img { width: 28px; height: 28px; }
}
