.flag-fields{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); gap:10px; }
.flag-config select,.flag-parts{ width:100%; min-width:0; }
.flag-config .flag-toggle{ display:flex; align-items:center; gap:8px; }
.flag-toggle input{ width:21px; min-height:21px; accent-color:#ffc86d; }
.flag-count,.flag-progress,.flag-selection{ margin:0; color:#f0e7ff; }
.flag-progress:empty,.flag-results:empty{ display:none; }
.flag-roundPanel,.flag-controls{ display:grid; gap:12px; }
.flag-strip{ display:flex; align-items:center; gap:10px; }
.flag-kicker{ margin:0; color:#d9b9ff; font-size:12px; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.flag-country{ margin:1px 0 0; font-size:clamp(23px,3.5vw,42px); line-height:1.1; overflow-wrap:anywhere; }
.flag-reference,.flag-board{ width:min(100%,520px); margin:0 auto; text-align:center; }
.flag-reference img,.flag-shape{ display:block; width:100%; max-height:36vh; margin:auto; object-fit:contain; }
.flag-reference p{ margin:5px 0 0; color:#dfd2fa; font-weight:700; }
.flag-shape path{ stroke:#253756; stroke-width:.72; vector-effect:non-scaling-stroke; }
.flag-board.is-editable path{ cursor:pointer; touch-action:manipulation; }
.flag-board path:is(:focus-visible,.is-target){ stroke:#ffe470; stroke-width:2; outline:none; }
.flag-board path[role="button"]:hover{ stroke:#f0d69b; stroke-width:1.5; }
.flag-palette{ display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.flag-palette button{
  display:grid; place-items:center; width:46px; height:46px; padding:2px;
  border:1px solid #9486ca; border-radius:50%; background:#221a40; cursor:pointer;
}
.flag-palette i{ width:100%; height:100%; border:1px solid #c6c7d8; border-radius:50%; background:var(--swatch); }
.flag-palette i.flag-eraser{ background:repeating-linear-gradient(135deg,#e0caff 0 4px,#5b437e 4px 8px); }
.flag-palette button[aria-pressed="true"]{ outline:2px solid #ffe093; outline-offset:1px; }
.flag-selection{ text-align:center; font-size:14px; }
.flag-details,.flag-history{
  padding:8px 10px; border:1px solid #7e6cad; border-radius:10px; background:#23183d;
}
.flag-details summary,.flag-history summary{ cursor:pointer; font-weight:700; }
.flag-details div{ display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; margin-top:6px; }
.flag-details label{ display:grid; gap:4px; }
.flag-results{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr)); gap:9px; }
.flag-player{
  min-width:0; padding:8px; border:1px solid #8a77b8; border-radius:11px;
  background:#241942; overflow-wrap:anywhere;
}
.flag-player .flag-shape{ max-height:95px; margin-top:5px; }
.flag-player header{ display:flex; align-items:center; gap:5px; }
.flag-player strong{ margin-left:auto; color:#ffe49a; font-size:20px; animation:flag-points .4s ease-out; }
.flag-player p{ margin:6px 0 0; color:#ede1ff; font-size:13px; }
@keyframes flag-points{ from{ opacity:.25; transform:translateY(5px); } }
.flag-history ol{ padding-left:20px; }
.flag-history li{ margin:5px 0; overflow-wrap:anywhere; }
.play .flag-reference img,.play .flag-board .flag-shape{ max-height:26vh; }
.host .flag-results{ max-height:35vh; overflow:auto; }
.play .flag-roundPanel.is-painting{ padding:10px; gap:10px; background:#151c32; }
.play .is-painting .flag-board{
  display:grid; place-items:center; min-height:31vh; padding:3px;
  border:2px solid #d7cbea; border-radius:9px; background:#fff;
}
.play .is-painting .flag-board .flag-shape{ max-height:36vh; }
.play .is-painting .flag-board path[data-part]{ stroke:#282334; }
.play .is-painting .flag-board path:is(:focus-visible,.is-target){ stroke:#b47100; }
@media(prefers-reduced-motion:reduce){ .flag-player strong{ animation:none; } }

/* Tap-to-fill studio: only the flag, palette and two simple actions. */
.flag-shape .flag-fixed{pointer-events:none;stroke:none!important}
.flag-paintActions{display:flex;gap:10px;justify-content:center}
.flag-paintActions .btn{min-height:48px;flex:1}
.play.flag-painting .flag-shell>.word-header{display:none}
.play.flag-painting #flagScreen{padding:8px;overflow:auto}
.play.flag-painting .flag-shell{width:100%;gap:0}
.play.flag-painting .flag-roundPanel{min-height:calc(100dvh - 16px);border-radius:20px;grid-template-rows:auto minmax(180px,1fr) auto auto;align-content:stretch}
.play.flag-painting .flag-board{width:100%;min-height:0;padding:10px;align-self:stretch}
.play.flag-painting .flag-board .flag-shape{max-height:57dvh;width:100%;height:100%}
.play.flag-painting .flag-kicker{display:none}
.play.flag-painting .flag-country{font-size:23px}
.play.flag-painting .flag-timer{margin-left:auto}
.play.flag-painting .flag-controls{gap:8px}
.play.flag-painting .flag-palette{gap:12px}
.play.flag-painting .flag-palette button{width:54px;height:54px;border:3px solid #343053}
.play.flag-painting .flag-palette button[aria-pressed="true"]{outline:3px solid #ffda50;outline-offset:3px;transform:scale(1.06)}
.play.flag-painting .flag-progress{font-size:12px;text-align:center}
.play.flag-painting .flag-selection{font-size:13px}
@media(orientation:landscape) and (max-height:600px){
 .play.flag-painting .phone{max-width:none}
 .play.flag-painting .flag-roundPanel{grid-template-columns:minmax(0,1fr) 200px;grid-template-rows:auto minmax(160px,1fr) auto;gap:8px}
 .play.flag-painting .flag-strip{grid-column:1/-1}
 .play.flag-painting .flag-board{grid-column:1;grid-row:2/4}
 .play.flag-painting .flag-board .flag-shape{max-height:75dvh}
 .play.flag-painting .flag-controls{grid-column:2;align-content:center}
 .play.flag-painting .flag-progress{grid-column:2}
 .play.flag-painting .flag-paintActions{flex-direction:column}
 .play.flag-painting .flag-palette button{width:48px;height:48px}
}
