.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.mode-card {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 13px; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.22)); border: 1px solid rgba(255, 255, 255, 0.09);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.mode-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.mode-card.on {
  border-color: rgba(242, 193, 78, 0.85); background: linear-gradient(180deg, rgba(242, 193, 78, 0.16), rgba(80, 50, 10, 0.25));
  box-shadow: 0 0 0 1px rgba(242, 193, 78, 0.35) inset, 0 6px 18px rgba(0, 0, 0, 0.35);
}
.mc-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #e9dcc4;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.35)); border: 1px solid rgba(255, 255, 255, 0.12);
}
.mc-ico svg { width: 20px; height: 20px; }
.mode-card.on .mc-ico { color: #241703; background: linear-gradient(180deg, #ffe08a, #d29a26); border-color: rgba(255, 230, 160, 0.8); }
.mc-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mc-txt b { font-family: var(--title); font-size: 15px; color: var(--text); }
.mode-card.on .mc-txt b { color: var(--gold); }
.mc-txt em { font-style: normal; font-size: 12px; line-height: 1.4; color: var(--muted); }
.mc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.mc-chips i {
  font-style: normal; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; color: #f6e7c0;
  background: rgba(242, 193, 78, 0.12); border: 1px solid rgba(242, 193, 78, 0.28);
}
#scr-versus .panel { display: flex; flex-direction: column; }
#scr-versus .panel.in-room > .panel-head { order: -2; }
#scr-versus .panel.in-room > #vs-online { order: -1; margin-bottom: 8px; }
#vs-settings { margin-bottom: 4px; }
#vs-settings .form { margin-top: 10px; }
#vs-gold-field.disabled { opacity: 0.4; pointer-events: none; }

.lobby { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 4px; animation: rise 0.3s ease-out; }
.lb-top { display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.lb-code-box, .lb-invite {
  display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 13px;
  background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.08);
}
.lb-code-box { align-items: center; }
.lb-label { font-size: 11.5px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.lb-code {
  position: relative; padding: 6px 18px; border-radius: 12px; cursor: pointer; border: 1px solid rgba(255, 230, 160, 0.7);
  font: 900 34px/1.1 var(--ui); letter-spacing: 10px; padding-right: 8px; color: #241703;
  background: linear-gradient(180deg, #ffe9a6, #e0a52c); box-shadow: 0 3px 0 #7a5410, 0 0 24px rgba(242, 193, 78, 0.25);
  transition: transform 0.1s, filter 0.15s;
}
.lb-code:hover { filter: brightness(1.08); }
.lb-code:active { transform: translateY(2px); box-shadow: 0 1px 0 #7a5410; }
.lb-code.copied::after, #lb-copy-link.copied::after {
  content: 'Kopyalandı ✓'; position: absolute; left: 50%; top: -30px; transform: translateX(-50%); white-space: nowrap;
  padding: 3px 10px; border-radius: 8px; background: #1f6f45; color: #e8fff1; font: 800 12px var(--ui); letter-spacing: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); animation: copiedIn 0.2s ease-out;
}
#lb-copy-link { position: relative; }
.lb-tip { font-size: 11.5px; color: var(--dim); }
.lb-link { width: 100%; font-size: 13px; color: #d9cdb5; }
.lb-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.lb-btns .btn { display: inline-flex; align-items: center; gap: 6px; }
.lb-btns svg { width: 15px; height: 15px; }
.lb-players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.lb-p {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 13px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.08); min-width: 0;
}
.lb-p.blue { border-left: 4px solid var(--blue); }
.lb-p.red { border-left: 4px solid var(--red); }
.lb-p .crest { flex: 0 0 auto; width: 30px; height: 30px; }
.lb-p .crest svg { width: 16px; height: 16px; }
.lb-p div { display: flex; flex-direction: column; min-width: 0; }
.lb-p b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-p em { font-style: normal; font-size: 12px; color: var(--muted); }
.lb-p span:not(.crest) { font-size: 11.5px; font-weight: 900; color: var(--dim); }
.lb-p span.ready { color: var(--green); }
.lb-vs { font-family: var(--title); font-weight: 900; font-size: 22px; color: var(--gold); text-shadow: 0 2px 0 #000; }
.lb-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(242, 193, 78, 0.08); border: 1px solid rgba(242, 193, 78, 0.25); }
.lb-summary b { width: 100%; font-size: 13px; color: var(--gold); }
.lb-summary i { font-style: normal; font-size: 12.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); color: #f1e6cf; }
.lobby .panel-foot { margin-top: 2px; }
#lb-start:disabled { filter: grayscale(0.7); }

.countdown { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 60%); }
.countdown span {
  font: 900 clamp(90px, 22vh, 200px)/1 var(--title); color: #fff3cc;
  text-shadow: 0 6px 0 #2a1a04, 0 0 40px rgba(242, 193, 78, 0.6); animation: countPop 0.9s ease-out both;
}
.countdown.go span { font-size: clamp(60px, 14vh, 130px); color: #ffd56a; letter-spacing: 4px; }
@keyframes countPop { 0% { transform: scale(1.8); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(0.9); opacity: 0.15; } }
@keyframes copiedIn { from { opacity: 0; transform: translate(-50%, 6px); } }

.vs-clock {
  position: absolute; top: calc(50% - 15px); left: 50%; transform: translateX(-50%); z-index: 2; padding: 4px 12px; border-radius: 999px;
  background: rgba(10, 8, 6, 0.85); border: 1px solid var(--line-strong); color: var(--gold); font: 900 14px var(--ui); pointer-events: none;
}
.vs-clock:empty { display: none; }
.vs-clock.warn { color: #ff8b80; border-color: rgba(239, 65, 54, 0.7); animation: clockWarn 1s ease-in-out infinite; }
@keyframes clockWarn { 50% { transform: translateX(-50%) scale(1.08); } }
.vu.locked, .vr.locked { opacity: 0.22; filter: grayscale(1); pointer-events: none; }
.vr.locked { pointer-events: auto; cursor: not-allowed; }
#r-next.pulse { animation: nextPulse 1.2s ease-in-out infinite; }
@keyframes nextPulse { 50% { box-shadow: 0 0 0 6px rgba(242, 193, 78, 0.35); } }

@media (max-width: 760px) {
  .lb-top { grid-template-columns: 1fr; }
  .lb-players { grid-template-columns: 1fr; }
  .lb-vs { text-align: center; }
  .modes { grid-template-columns: 1fr; }
}
@media (max-height: 560px) {
  .mc-txt em { display: none; }
  .mode-card { padding: 7px 10px; }
}

.pause-note { margin: -4px 0 12px; font-size: 14px; color: #e8c46a; }
.pause-opt { justify-content: center; margin: 0 0 16px; font-size: 13.5px; opacity: 0.9; }
.lb-net { margin: 0; text-align: center; font-size: 13px; font-weight: 700; color: #9fd08a; }
.lb-net.relay { color: #e8c46a; }

.st-box { position: relative; isolation: isolate; }
.st-box > button { position: relative; z-index: 1; }
.st-pill {
  position: absolute; left: 0; top: 0; z-index: 0; width: 0; height: 0; border-radius: 10px; pointer-events: none; opacity: 0;
  border: 1px solid var(--gold); background: linear-gradient(180deg, #7a5d1c, #3d2e10);
  box-shadow: inset 0 0 14px rgba(242, 193, 78, 0.35), 0 0 12px rgba(242, 193, 78, 0.2);
  transition: transform 0.42s cubic-bezier(0.34, 1.32, 0.52, 1), width 0.3s ease, height 0.3s ease, opacity 0.2s ease;
}
.st-pill.on { opacity: 1; }
.st-pill.kick { animation: pillFlash 0.55s ease-out; }
.stances.st-box .stance { background: linear-gradient(180deg, rgba(58, 51, 44, 0.55), rgba(30, 26, 22, 0.55)); transition: border-color 0.15s, transform 0.12s cubic-bezier(0.3, 0.7, 0.4, 1); }
.stances.st-box .stance svg, .stances.st-box .stance span { transition: color 0.25s, opacity 0.25s; }
.stances.st-box .stance:not(.active) svg { opacity: 0.8; }
.stances.st-box .stance:not(.active) span { opacity: 0.85; }
.st-box > button.active, .stances.st-box .stance.active { background: transparent; border-color: transparent; box-shadow: none; }
.vsp-g { display: flex; align-items: center; gap: 4px; }
.vsp-g.st-box .st-pill { border-radius: 8px; border-color: var(--line-strong); background: linear-gradient(180deg, rgba(242, 193, 78, 0.5), rgba(150, 100, 20, 0.5)); box-shadow: 0 0 10px rgba(242, 193, 78, 0.25); }
.st-box > button[data-stance="attack"] { --kick: var(--dir, 1); }
.st-box > button[data-stance="garrison"] { --kick: calc(var(--dir, 1) * -1); }
.st-box > button[data-stance="defend"] { --kick: 0; }
.st-box > button.kick svg { animation: stanceKick 0.5s cubic-bezier(0.3, 0.7, 0.4, 1); }
@keyframes stanceKick {
  0% { transform: none; }
  35% { transform: translateX(calc(var(--kick) * 6px)) scale(1.2); }
  70% { transform: translateX(calc(var(--kick) * -1.5px)) scale(0.96); }
  100% { transform: none; }
}
@keyframes pillFlash {
  0% { box-shadow: inset 0 0 14px rgba(242, 193, 78, 0.35), 0 0 0 0 rgba(242, 193, 78, 0.55); }
  100% { box-shadow: inset 0 0 14px rgba(242, 193, 78, 0.35), 0 0 0 10px rgba(242, 193, 78, 0); }
}
.vsp.red { left: auto; right: 8px; }
.vsp.red .vsp-top, .vsp.red .vsp-row { flex-direction: row-reverse; }
.vsp.red .vsp-hp i { margin-left: auto; }
@media (prefers-reduced-motion: reduce) {
  .st-pill { transition: opacity 0.2s; }
  .st-pill.kick, .st-box > button.kick svg { animation: none; }
}
