/* The army, the tribes, war and building with blocks. */
.btn-xs { padding: 3px 8px; font-size: 12px; min-height: 0; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.power-pill { font-family: var(--serif); color: var(--gold-dark); }
.rank-head { display: flex; gap: 14px; align-items: center; margin: 6px 0 12px; }
.rank-badge { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 24px; color: #fff7e0;
  background: radial-gradient(circle at 40% 35%, #c9a14a, #6b4a12); box-shadow: 0 0 0 2px var(--gold-dark), 0 4px 12px rgba(0, 0, 0, 0.25); }
.rank-head h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; }
.rank-head .fa { color: var(--madder); margin-left: 8px; }
.xpbar { height: 8px; border-radius: 6px; background: rgba(90, 60, 20, 0.18); overflow: hidden; min-width: 220px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--turq), #6fd6c8); }
.unlocks { list-style: none; padding: 0; margin: 6px 0 12px; display: grid; gap: 4px; font-size: 13px; }
.unlocks li { color: var(--ink-faint); }
.unlocks li.got { color: var(--ink); }
.unlocks li.got b { color: var(--turq); }
.unlocks .fa, .ranks .fa { color: var(--madder); margin-left: 6px; font-size: 12px; }
.ranks { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.ranks span { padding: 4px 8px; border-radius: 8px; background: rgba(255, 252, 240, 0.5); color: var(--ink-faint); }
.ranks span.got { color: var(--ink); box-shadow: inset 0 0 0 1px var(--gold-dark); }
.soldier .btns, .member .btns, .charter .btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.member-list { display: grid; gap: 6px; margin: 6px 0 10px; }
.member { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-radius: 10px; background: rgba(255, 252, 240, 0.5); }
.member small { color: var(--ink-faint); }
.member .btns { margin-left: auto; }
.role { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(90, 60, 20, 0.12); }
.role.chief { background: var(--gold-dark); color: #fff7e0; }
.role.elder { background: rgba(42, 166, 161, 0.25); }
.rel { font-size: 11px; padding: 2px 6px; border-radius: 6px; }
.rel.alliance { background: rgba(42, 166, 161, 0.3); }
.rel.war { background: rgba(156, 31, 36, 0.3); }
.tribe-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.tribe-head h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 22px; }
.tribe-head .tag { color: var(--gold-dark); }
.tribe-head .motto { margin: 2px 0 6px; font-style: italic; color: var(--ink-soft); }
.flag-mini { border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2); flex: none; }
.flag-editor { display: grid; grid-template-columns: 170px 1fr; gap: 14px; margin: 8px 0; }
.flag-fields { display: grid; gap: 8px; font-size: 12.5px; }
.flag-fields label { display: grid; gap: 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.sw { width: 22px; height: 22px; border-radius: 5px; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); }
.sw.on { box-shadow: 0 0 0 2px #fff7e0, 0 0 0 4px var(--gold-dark); }
.charter-list { display: grid; gap: 8px; }
.charter { padding: 8px 12px; border-radius: 10px; background: rgba(255, 252, 240, 0.55); box-shadow: inset 0 0 0 1px rgba(138, 106, 38, 0.3); }
.charter > div:first-child { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.charter .status { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(90, 60, 20, 0.12); }
.charter.accepted .status, .charter.battle .status { background: rgba(42, 166, 161, 0.3); }
.charter.declared .status { background: rgba(156, 31, 36, 0.25); }
.charter p { margin: 6px 0; font-size: 13.5px; white-space: pre-wrap; }
.chronicle { display: grid; gap: 4px; font-size: 13px; max-height: 50vh; overflow: auto; }
.chronicle small { color: var(--ink-faint); }
.rank-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rank-table th { text-align: left; font-family: var(--serif); font-weight: 400; color: var(--ink-faint); border-bottom: 1px solid rgba(138, 106, 38, 0.4); padding: 4px 6px; }
.rank-table td { padding: 4px 6px; border-bottom: 1px solid rgba(138, 106, 38, 0.15); }
.rank-table tr.me td { background: rgba(42, 166, 161, 0.15); }
.tiers { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.tier { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; }
.tier.bronze { background: #c98a5a33; }
.tier.silver { background: #b9bcc455; }
.tier.gold { background: #d6a63766; }
.tier.royal { background: #5b2a6e44; }
.block-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.block-card { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border-radius: 10px; border: 0; cursor: pointer; background: rgba(255, 252, 240, 0.6); box-shadow: inset 0 0 0 1px rgba(138, 106, 38, 0.35); color: var(--ink); }
.block-card:hover { box-shadow: inset 0 0 0 2px var(--turq); }
.block-card.short { opacity: 0.55; }
.block-card small { color: var(--ink-faint); font-size: 11px; }
.bswatch { display: inline-block; width: 22px; height: 22px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); }
.blockbar { flex-direction: column; align-items: stretch; gap: 6px; }
.blockbar .palette { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.blockbar .pal { display: grid; place-items: center; gap: 1px; padding: 3px; border-radius: 8px; border: 0; background: rgba(11, 18, 48, 0.6); cursor: pointer; color: #f3ead3; }
.blockbar .pal.on { box-shadow: 0 0 0 2px #ffe7a8; }
.blockbar .pal.short { opacity: 0.45; }
.blockbar .pal small { font-size: 10px; }
.blockbar-row { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }

/* the drill */
.drill-layer { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(7, 11, 31, 0.45); backdrop-filter: blur(2px); pointer-events: auto; z-index: 15; padding: 12px; }
.drill-card { width: min(800px, 96vw); max-height: calc(100vh - 24px); overflow: auto; padding: 16px 20px 18px; }
.drill-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.drill-head b { font-family: var(--serif); font-weight: 400; font-size: 21px; }
.drill-head .fa { color: var(--madder); }
.drill-kicker { flex-basis: 100%; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-dark); }
.drill-note { font-size: 13px; color: var(--ink-soft); margin: 4px 0 10px; }
.drill-stage { position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 6px 18px rgba(40, 24, 8, 0.25); }
.drill-canvas { display: block; width: 100%; aspect-ratio: 720 / 300; height: auto; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.drill-canvas.demo { cursor: default; }
.drill-status { margin: 10px 0 8px; font-family: var(--serif); min-height: 22px; text-align: center; }
.drill-status .hint { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); }
.drill-actions { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }

/* the bar above the field: shots left, the time, the score */
.drill-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.drill-pips { display: flex; gap: 5px; }
.drill-pips .pip { width: 12px; height: 26px; border-radius: 6px 6px 3px 3px; background: linear-gradient(#e7dcc0 0 22%, #6b4a2a 22% 100%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); transition: transform 0.2s, opacity 0.2s; }
.drill-pips .pip.spear { background: linear-gradient(#d4d8de 0 26%, #6b4a2a 26% 100%); width: 9px; }
.drill-pips .pip.used { opacity: 0.95; transform: translateY(2px) scale(0.9); background: #a8a094; }
.drill-pips .pip.used[data-pts="10"] { background: #e2b84a; box-shadow: 0 0 8px rgba(226, 184, 74, 0.8); }
.drill-pips .pip.used[data-pts="8"] { background: #b8202a; }
.drill-pips .pip.used[data-pts="6"] { background: #2b4f9f; }
.drill-pips .pip.used[data-pts="4"] { background: #2a2622; }
.drill-pips .pip.used[data-pts="2"] { background: #efe4c8; }
.drill-pips .pip.used[data-pts="0"] { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(155, 44, 44, 0.6); }
.drill-time { flex: 1; height: 8px; border-radius: 4px; background: rgba(42, 29, 18, 0.15); overflow: hidden; }
.drill-time i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--turq-deep), var(--turq)); border-radius: 4px; transition: width 0.1s linear; }
.drill-time i.low { background: linear-gradient(90deg, var(--madder), #d0602a); }
.drill-total { display: flex; flex-direction: column; align-items: center; min-width: 54px; line-height: 1.05; }
.drill-total small { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.drill-total b { font-family: var(--serif); font-size: 24px; color: var(--ink); }

/* the verdict, over the field */
.drill-result { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  background: rgba(20, 12, 4, 0.62); color: #f6eedb; font-family: var(--serif); animation: drill-in 0.3s ease-out; }
.drill-result .stars { font-size: 38px; letter-spacing: 6px; line-height: 1; }
.drill-result .stars i { font-style: normal; color: rgba(255, 255, 255, 0.22); }
.drill-result .stars i.on { color: #f0c85a; text-shadow: 0 0 12px rgba(240, 200, 90, 0.7); }
.drill-result .big { font-size: 30px; color: #ffe9a8; }
.drill-result .drill-actions { margin-top: 10px; }
@keyframes drill-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }

/* the guide before a drill */
.guide-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.demo-tag { position: absolute; top: 8px; inset-inline-end: 8px; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: rgba(20, 12, 4, 0.6); color: #ffe9a8; pointer-events: none; }
.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 10px; }
.guide-steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.guide-steps li::before { content: counter(step); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--lapis); color: var(--gold-light); font-family: var(--serif); font-size: 15px; box-shadow: inset 0 0 0 1px var(--gold-dark); }
.guide-steps li b { color: var(--ink); font-family: var(--serif); font-weight: 400; font-size: 15px; }
.guide-bands { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.guide-bands .lbl { color: var(--ink-faint); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.guide-bands .band { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.guide-bands .band i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3); }
.guide-bands .band i.miss { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(155, 44, 44, 0.6); }
.guide-skip { display: flex; align-items: center; gap: 8px; margin: 12px 0 10px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; }
.guide-skip input { width: 16px; height: 16px; accent-color: var(--turq-deep); }
.drill-list .build .btns, .drill-list .build .drill-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.soldier .grade { display: inline-block; margin-inline-start: 8px; padding: 1px 8px; border-radius: 9px; font-size: 11px; vertical-align: 2px; background: rgba(42, 29, 18, 0.12); color: var(--ink-soft); }
.soldier .grade.g1 { background: rgba(43, 79, 159, 0.15); color: var(--lapis); }
.soldier .grade.g2 { background: rgba(184, 134, 58, 0.2); color: var(--gold-dark); }
.soldier .grade.g3 { background: linear-gradient(90deg, #e2b84a, #f0c85a); color: #3a2410; }
@media (max-width: 640px) {
  .guide-grid { grid-template-columns: 1fr; }
  .drill-card { padding: 12px 12px 14px; }
  .drill-bar { gap: 8px; }
  .drill-pips .pip { width: 9px; height: 20px; }
}

/* the battle */
.battle { position: absolute; inset: 0; pointer-events: none; z-index: 12; }
.battle-top { position: absolute; top: calc(10px + var(--safe-t, 0px)); left: 50%; transform: translateX(-50%); display: flex; gap: 16px; align-items: center;
  padding: 6px 14px; border-radius: 14px; background: rgba(11, 18, 48, 0.82); color: #f3ead3; box-shadow: inset 0 0 0 1px var(--gold-dark); pointer-events: auto; }
.battle-top .side { display: flex; gap: 8px; align-items: center; opacity: 0.8; }
.battle-top .side.mine { opacity: 1; }
.battle-top .side.mine b { color: #ffe7a8; }
.battle-top .mid { text-align: center; min-width: 170px; }
.battle-top .score { font-family: var(--serif); font-size: 26px; line-height: 1; }
.battle-top .phase { font-size: 12.5px; }
.battle-top .phase .fa { margin-left: 6px; color: #e7c98a; }
.battle-top .clock { font-size: 12px; color: #b8c0e0; }
.battle-box { position: absolute; left: 50%; bottom: calc(110px + var(--safe-b, 0px)); transform: translateX(-50%); pointer-events: auto; max-width: 94vw; }
.battle-card { padding: 14px 18px; min-width: min(460px, 92vw); }
.battle-card h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; }
.battle-card h3 .fa { color: var(--madder); margin-left: 8px; font-size: 14px; }
.battle-strip { display: flex; gap: 12px; align-items: center; padding: 8px 14px; border-radius: 12px; background: rgba(11, 18, 48, 0.82); color: #f3ead3; }
.battle-strip .captures { font-family: var(--serif); color: #ffe7a8; }
.battle-feed { position: absolute; right: 14px; top: calc(240px + var(--safe-t, 0px)); display: grid; gap: 4px; font-size: 12.5px; color: #f3ead3; text-shadow: 0 1px 2px #000; }
.vote-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.vote-list .n { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: rgba(42, 166, 161, 0.3); }
.duel-head { font-family: var(--serif); font-size: 16px; margin: 4px 0 8px; }
.strength { margin: 4px 0; }
.riddle-q { font-size: 16px; margin: 8px 0 2px; }
.riddle-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.riddle-opts .right { box-shadow: inset 0 0 0 2px var(--turq); background: rgba(42, 166, 161, 0.2); }
.score.big { font-family: var(--serif); font-size: 40px; text-align: center; margin: 8px 0; }
.chat .line.ch-tribe b, .chat .line.ch-tribe .chan { color: #ffd27a; }
.chat .line.ch-team b, .chat .line.ch-team .chan { color: #7fd8ff; }
@media (max-width: 760px) {
  .flag-editor { grid-template-columns: 1fr; }
  .riddle-opts { grid-template-columns: 1fr; }
  .battle-top { gap: 8px; padding: 4px 8px; }
  .battle-top .side b { display: none; }
}

/* the creator: man or woman */
.gender-row { display: flex; gap: 8px; justify-content: center; margin: 4px 0 10px; }
.gender-row .gender.on { background: var(--turq); color: #fff; box-shadow: inset 0 0 0 1px var(--gold-dark); }
