/* Mission 03: Shield Tactics. User asked for a colourful, game-like, slightly 3D look.
   Colour codes a category (lane, threat kind, card family) and always sits beside an icon and words.
   Depth cues (tilted table, standing tokens, isometric office) make the board read as a game table. */
.navy, .tactics { --accent: #173c57; --accent-light: #e6edf3; }
.tx-brand { display: inline-flex; align-items: center; gap: 8px; }
.tx-emblem { width: 26px; height: 28px; flex: 0 0 auto; }
.tx-emblem.big { width: 60px; height: 66px; }
.mission-flag { padding: 4px 8px; border-radius: 4px; background: #fff1d6; color: #7a4a12; font-size: .74rem; font-weight: 700; }
.tactics-card { grid-column: 1 / -1; }
.tactics-card .mission-preview { position: relative; background: linear-gradient(180deg, #d4eaff, #f3f9ff); }
.txp { position: relative; height: 100%; display: grid; align-items: end; justify-items: center; }
.txp-hq { width: min(330px, 100%); }
.txp-token { position: absolute; animation: bob 3s ease-in-out infinite; }
.txp-token.p0 { left: 12%; top: 16%; }.txp-token.p1 { left: 44%; top: 2%; animation-delay: .6s; }.txp-token.p2 { right: 12%; top: 20%; animation-delay: 1.2s; }

/* Kind colours: medal fill and plate border. */
.k-unknown { --k: #475569; }
.k-phishing { --k: #d92d20; }
.k-impersonation { --k: #7c3aed; }
.k-mfa { --k: #c2410c; }
.k-rogue-wifi { --k: #be185d; }
.k-shadow-ai { --k: #a16207; }
.k-incident { --k: #9f1239; }
.k-legit, .k-own-mfa, .k-share-task { --k: #15803d; }
.tx-medal { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; color: #fff; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--k) 55%, #fff) 0 16%, var(--k) 62%); box-shadow: 0 4px 0 color-mix(in srgb, var(--k) 62%, #000), 0 9px 14px #0f2a402e; }
.tx-medal .icon { width: 24px; height: 24px; stroke-width: 2; }
.tx-medal.small { width: 34px; height: 34px; }.tx-medal.small .icon { width: 18px; height: 18px; }

/* Header, HUD and guidance */
.tx-wavebar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 32px; margin: 22px 0 16px; }
.tx-wavebar > div { min-width: 0; }
.tx-wavebar h1 { font-size: clamp(1.8rem, 2.8vw, 2.4rem); }
.tx-hud { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.tx-hud > div { min-width: 96px; padding: 10px 14px; border: 1px solid var(--line); border-top: 4px solid #2f7fd1; border-radius: 10px; background: #fff; }
.tx-hud > div:nth-child(2) { border-top-color: #f5a623; }.tx-hud > div:nth-child(3) { border-top-color: #7c3aed; }
.tx-hud dt { font-size: .74rem; color: var(--muted); }
.tx-hud dd { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-weight: 800; font-size: 1.05rem; }
.tx-hud > div.flash { animation: shake .45s ease-out; border-color: #d92d20; }
.tx-shields { display: inline-flex; gap: 2px; }
.tx-shields i { display: inline-flex; color: #2f7fd1; }.tx-shields i.off { color: #d92d20; }
.tx-shields .icon { width: 22px; height: 22px; }
.tx-shields i.on .icon path:first-child { fill: #d6ebff; }
.tx-energy { display: inline-flex; gap: 3px; }
.tx-gem-icon { width: 18px; height: 18px; }
.tx-gem-icon polygon { fill: #fff5e0; stroke: #b7791f; stroke-width: 1.4; }
.tx-gem-icon.on polygon { fill: #f5a623; }
.tx-coach { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid #f0d08a; border-radius: var(--radius); background: #fff8e6; }
.tx-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tx-steps li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid #e8d3a0; border-radius: 8px; background: #fff; color: #52616e; font-size: .78rem; font-weight: 700; }
.tx-steps li span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #eef2f5; }
.tx-steps li.current { border-color: var(--navy); background: var(--navy); color: #fff; }
.tx-steps li.current span { background: #f5a623; color: #2b1a00; }
.tx-steps li.done span { background: #15803d; color: #fff; }
.tx-coach p { display: flex; flex: 1 1 280px; gap: 8px; align-items: flex-start; color: #5a3d00; font-size: .88rem; font-weight: 600; }
.tx-coach p .icon { width: 18px; height: 18px; margin-top: 2px; color: #b7791f; }

/* Wave intro banner */
.tx-intro { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px 24px; margin-bottom: 18px; padding: 20px 24px; border-radius: var(--radius); color: #fff; background: linear-gradient(120deg, #173c57, #245c8e); animation: reveal .4s ease-out; }
.tx-intro h2 { color: #fff; font-size: 1.6rem; }
.tx-intro p { color: #eef6ff; margin-top: 6px; }
.tx-intro-mark { position: relative; }
.tx-intro-mark > span { position: absolute; right: -6px; bottom: -4px; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #f5a623; color: #2b1a00; font-weight: 800; }
.tx-intro .tx-intro-sub { margin-top: 12px; color: #ffd166; font-size: .76rem; font-weight: 800; }
.tx-kinds { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; padding: 0; list-style: none; }
.tx-kinds li { display: flex; align-items: center; gap: 8px; max-width: 320px; padding: 6px 10px 6px 6px; border-radius: 10px; background: #ffffff1c; font-size: .76rem; line-height: 1.4; color: #eef6ff; }
.tx-kinds strong { display: block; color: #fff; font-size: .8rem; }
.tx-intro .button.primary, .tx-end.button.primary { background: #f5a623; color: #2b1a00; }
.tx-intro .button.primary:hover, .tx-end.button.primary:hover { background: #ffb83d; }
.tx-intro .button.primary, .tx-end.button.primary, .tx-intro .button.primary:hover, .tx-end.button.primary:hover { box-shadow: 0 4px 0 #b7791f; }

/* Board: a tilted table with standing tokens. */
.tx-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.tx-board { padding: 14px 14px 10px; border: 1px solid #c6dcef; border-radius: var(--radius); background: linear-gradient(180deg, #d4e9ff 0%, #ecf6ff 55%, #f8fbff 100%); overflow: hidden; }
.tx-stage { perspective: 1100px; perspective-origin: 50% 0; }
.tx-lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto repeat(3, auto); gap: 8px 10px; transform: rotateX(16deg); transform-origin: 50% 100%; }
.lane-mail { --lane: #2563eb; --lane-light: #e3edff; }
.lane-chat { --lane: #7c3aed; --lane-light: #efe8ff; }
.lane-work { --lane: #0f766e; --lane-light: #dcf5f0; }
.tx-lane { display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; min-width: 0; }
.tx-lane h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-self: start; max-width: 100%; min-width: 0; overflow-wrap: anywhere; padding: 4px 9px; border-radius: 6px; background: var(--lane); color: #fff; font-size: .78rem; letter-spacing: 0; }
.tx-lane h2 .icon { width: 15px; height: 15px; flex: 0 0 auto; }
.tx-lane ol { display: grid; grid-row: 2 / -1; grid-template-rows: subgrid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tx-cell { display: grid; gap: 8px; align-content: start; min-height: 112px; padding: 8px 6px 6px; border: 1.5px dashed color-mix(in srgb, var(--lane) 45%, #fff); border-radius: 12px; background: var(--lane-light); }
.tx-lane li:last-child { border-style: solid; box-shadow: inset 0 -4px 0 #f5a62366; }
.tx-empty { align-self: center; justify-self: center; font-size: .8rem; font-weight: 800; color: #52616e; }
.tx-item { position: relative; display: block; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; text-align: center; transform: rotateX(-16deg); transform-origin: 50% 100%; }
.tx-body { display: grid; justify-items: center; gap: 5px; transition: transform .18s; }
.tx-item:hover:not(.resolved) .tx-body { transform: translateY(-4px); }
.tx-plate { display: grid; gap: 2px; width: 100%; padding: 6px 7px; border: 2px solid var(--k); border-radius: 9px; background: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--k) 40%, #fff); font-size: .76rem; line-height: 1.3; overflow-wrap: anywhere; }
.tx-item.unknown .tx-plate { border-style: dashed; }
.tx-item.unknown .tx-medal { animation: beckon 1.8s ease-in-out infinite; }
.tx-tag { font-size: .66rem; font-weight: 800; color: var(--k); }
.tx-title { font-weight: 600; color: var(--ink); }
.tx-note { font-size: .68rem; font-weight: 700; color: #7a4a12; }
.tx-item.target { cursor: crosshair; }
.tx-item.target .tx-plate { outline: 3px solid #f5a623; outline-offset: 2px; }
.tx-item.target .tx-medal { box-shadow: 0 4px 0 color-mix(in srgb, var(--k) 62%, #000), 0 0 0 5px #ffd166; }
.tx-item.focused .tx-plate { box-shadow: 0 0 0 3px var(--navy); }
.tx-item.resolved { cursor: default; }
.tx-item.resolved .tx-medal { box-shadow: none; transform: scale(.85); }
.tx-item.just-played .tx-body { animation: impact .5s ease-out; }
.tx-item.arrive .tx-body { animation: drop .6s cubic-bezier(.2, .9, .3, 1.25); }
.tx-item.boss .tx-medal { width: 58px; height: 58px; }.tx-item.boss .tx-medal .icon { width: 30px; height: 30px; }
.tx-pips { display: flex; justify-content: center; gap: 4px; margin-top: 2px; }
.tx-pips i { width: 11px; height: 11px; border: 2px solid var(--k); border-radius: 50%; }
.tx-pips i.on { background: var(--k); }
.tx-stamp { justify-self: center; padding: 2px 7px; border-radius: 4px; font-size: .7rem; font-weight: 800; color: var(--st, var(--ink)); background: var(--st-fill, #eef2f5); animation: stamp .4s ease-out; }
.st-neutralised, .st-completed { --st: #15803d; --st-fill: #e7f7ec; }
.st-blocked, .st-missed { --st: #7a4a12; --st-fill: #fff1d9; }
.st-breached { --st: #b42318; --st-fill: #fdecea; }
.tx-float { position: absolute; top: -4px; left: 0; right: 0; z-index: 3; width: fit-content; max-width: 100%; margin: 0 auto; padding: 3px 8px; border-radius: 6px; background: #15803d; color: #fff; font-size: .78rem; font-weight: 800; pointer-events: none; animation: float-up 1.2s ease-out forwards; }
.tx-float.risk { background: #b42318; }.tx-float.partial { background: #8a5a00; }
.tx-base { position: relative; display: grid; justify-items: center; margin-top: 2px; }
.tx-hq-art { width: min(340px, 92%); height: auto; overflow: visible; }
.dome-fill { fill: #7cc4ff; opacity: .2; }
.dome-seg { fill: none; stroke-width: 7; stroke-linecap: round; }
.dome-seg.on { stroke: #2f9bff; }
.dome-seg.off { stroke: #d92d20; stroke-dasharray: 6 9; }
.ground { fill: #c2d9ee; }.b-front { fill: #2b6ca3; }.b-side { fill: #1d4b75; }.b-roof { fill: #5aa0dd; }
.windows polygon { fill: #ffd166; }
.flag-pole { stroke: #173c57; stroke-width: 2; }.flag { fill: #f5a623; }
.tx-base.hit .tx-hq-art { animation: shake .5s ease-out; }
.tx-base.hit .dome-fill { fill: #d92d20; opacity: .28; }
.tx-base-label { display: inline-flex; align-items: center; gap: 6px; margin-top: -2px; padding: 6px 12px; border-radius: 8px; background: var(--navy); color: #fff; font-size: .84rem; font-weight: 700; }
.tx-base-label .icon { width: 17px; height: 17px; }

/* Side panels */
.tx-side { display: grid; gap: 14px; }
.tx-intel, .tx-log { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.tx-intel h2, .tx-log h2 { margin: 6px 0 10px; font-size: 1rem; letter-spacing: 0; }
.tx-intel.threat, .tx-intel.legit { border: 2px solid var(--k); }
.tx-intel .tx-tag { font-size: .74rem; }
.tx-kind-desc { margin-bottom: 10px; font-size: .84rem; color: var(--muted); }
.tx-intel.card-mode { border: 2px solid var(--f); background: color-mix(in srgb, var(--f) 7%, #fff); }
.tx-intel.card-mode .tx-card-icon { background: var(--f); color: #fff; }
.tx-flags, .tx-log ul, .tx-outcomes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tx-flags li, .tx-log li, .tx-outcomes li { display: flex; align-items: flex-start; gap: 8px; font-size: .82rem; line-height: 1.5; }
.tx-flags .icon, .tx-log .icon, .tx-outcomes .icon { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; }
.tx-log li.success .icon, .tx-outcomes li.success .icon { color: #15803d; }
.tx-log li.partial .icon, .tx-outcomes li.partial .icon { color: #8a5a00; }
.tx-log li.risk .icon, .tx-outcomes li.risk .icon { color: #b42318; }
.tx-log strong, .tx-outcomes strong { display: block; }
.tx-how { margin: 0; padding-left: 20px; font-size: .84rem; line-height: 1.6; }
.tx-help { margin-top: 10px; font-size: .8rem; color: var(--muted); }

/* Hand of cards: colour band by action family, gold energy gem. */
.fam-defend { --f: #2563eb; }.fam-verify { --f: #0f766e; }.fam-work { --f: #15803d; }.fam-respond { --f: #7c3aed; }.fam-shortcut { --f: #c2410c; }
.tx-hand { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.tx-hand-head, .tx-hand-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.tx-hand-head h2 { font-size: 1rem; letter-spacing: 0; }
.tx-hand-head span { font-size: .8rem; color: var(--muted); }
.tx-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin: 12px 0 14px; }
.tx-card { display: grid; grid-template-rows: auto 1fr; min-width: 0; min-height: 150px; padding: 0; overflow: hidden; text-align: left; border: 2px solid var(--f); border-radius: 12px; background: #fff; box-shadow: 0 5px 0 color-mix(in srgb, var(--f) 60%, #000), 0 10px 18px #0f2a401f; transition: transform .18s, box-shadow .18s; }
.tx-card:hover { transform: perspective(700px) rotateX(8deg) translateY(-6px); }
.tx-card.selected { transform: translateY(-10px); box-shadow: 0 0 0 4px #ffd166, 0 16px 26px #0f2a4038; }
.tx-card.short { filter: grayscale(.9); cursor: not-allowed; }
.tx-card.short:hover { transform: none; }
.tx-card-top { position: relative; display: flex; align-items: center; justify-content: center; height: 58px; background: var(--f); color: #fff; }
.tx-card-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: #ffffff2e; }
.tx-card-icon .icon { width: 22px; height: 22px; stroke-width: 2; }
.tx-gem { position: absolute; left: 8px; top: 8px; display: flex; align-items: center; justify-content: center; width: 26px; height: 28px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: #f5a623; color: #2b1a00; font-size: .85rem; font-weight: 800; }
.tx-key { position: absolute; right: 9px; top: 8px; font-size: .72rem; font-weight: 800; color: #fff; }
.tx-card-body { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 10px 12px 12px; font-size: .8rem; line-height: 1.4; overflow-wrap: anywhere; }
.tx-card-body strong { font-size: .9rem; color: var(--ink); }
.tx-hint { color: var(--muted); }
.tx-cost { font-size: .72rem; font-weight: 800; color: var(--f); }
.tx-hand-foot .tx-help { margin: 0; }
.tx-ghost { position: fixed; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 8px; border-radius: 12px; background: var(--f); color: #fff; font-size: .85rem; font-weight: 800; text-align: center; pointer-events: none; box-shadow: 0 12px 24px #0f2a4040; }

/* Results */
.tx-result { margin-top: 20px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.tx-outcomes { margin: 14px 0; }
.tx-wave-row { display: flex; flex-wrap: wrap; align-items: center; gap: 17px; padding: 18px 4px; border-top: 1px solid var(--line); }
.badge.navy.on { border-color: var(--navy); background: #e6edf3; }.badge.navy.on .badge-icon { background: var(--navy); }.badge.navy.on .badge-state { color: var(--navy); }

@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
@keyframes impact { 0% { transform: scale(1); } 30% { transform: scale(1.2) rotate(-5deg); } 100% { transform: none; } }
@keyframes drop { from { transform: translateY(-46px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes beckon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes float-up { 0% { opacity: 0; transform: translateY(6px) scale(.8); } 15% { opacity: 1; transform: translateY(-8px) scale(1.06); } 80% { opacity: 1; transform: translateY(-26px); } 100% { opacity: 0; transform: translateY(-36px); } }

@media (min-width: 900px) {
  .tactics-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; }
  .tactics-card .mission-topline { grid-column: 1 / -1; }
  .tactics-card .mission-preview { grid-row: 2 / 4; height: auto; min-height: 250px; margin-bottom: 24px; padding: 24px; }
  .tactics-card .mission-card-bottom { border-top: 1px solid var(--line); }
}
@media (max-width: 1100px) { .tx-layout { grid-template-columns: minmax(0, 1fr); } .tx-side { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); } }
@media (max-width: 620px) {
  .tx-board { padding: 8px 6px 6px; }.tx-lanes { gap: 6px 5px; transform: rotateX(10deg); }.tx-item { transform: rotateX(-10deg); }
  .tx-cell { min-height: 96px; padding: 6px 3px 4px; }.tx-plate { padding: 5px 4px; font-size: .7rem; }.tx-medal { width: 38px; height: 38px; }.tx-medal .icon { width: 20px; height: 20px; }
  .tx-lane h2 { padding: 3px 6px; font-size: .7rem; }.tx-hud { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }.tx-hud > div { min-width: 0; padding: 8px 10px; }
  .tx-hud dd { flex-wrap: wrap; gap: 5px; }.tx-shields .icon { width: 19px; height: 19px; }.tx-gem-icon { width: 14px; height: 14px; }
  .tx-intro { grid-template-columns: minmax(0, 1fr); padding: 18px; }.tx-intro-mark { display: none; }
  .tx-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }.tx-card { min-height: 140px; }.tx-result { padding: 18px; }
}
