/* Er Meydanı arayüzü. Giriş sayfası yedili oyun standardındadır: menü solda, oyunun canlı görüntüsü sağda (telefonda menü görüntünün üstünde). */
:root { --bg: #1d140f; --ink: #fff; --dim: #dcc9b4; --gold: #f6b93b; --org: #e58e26; --red: #e55039; --grn: #4ade80; --card: rgba(29, 20, 15, .9); --line: rgba(255, 255, 255, .16); --b1: #4a3426; --b2: #2a1c13; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 500 16px/1.35 'Baloo 2', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }

/* ---------- düğmeler ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 4px 16px 0; border: 0; border-radius: 16px; background: var(--b1); color: #fff; font-weight: 800; font-size: 17px; letter-spacing: .02em; cursor: pointer; box-shadow: 0 5px 0 var(--b2), 0 8px 18px rgba(0, 0, 0, .3); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--b2); }
.btn.pri { background: linear-gradient(180deg, #ffd87a, var(--gold) 45%, var(--org)); color: #3a1c00; box-shadow: 0 5px 0 #9c5a12, 0 8px 22px rgba(229, 142, 38, .45); }
.btn.pri:active { box-shadow: 0 1px 0 #9c5a12; }
.btn.red { background: linear-gradient(180deg, #f0735f, var(--red)); box-shadow: 0 5px 0 #96281a, 0 8px 22px rgba(229, 80, 57, .4); }
.btn.red:active { box-shadow: 0 1px 0 #96281a; }
.btn.xl { min-height: 68px; font-size: 28px; border-radius: 22px; }
.btn.sm { min-height: 44px; font-size: 14.5px; padding: 3px 10px 0; border-radius: 14px; }
.btn.ghost { background: rgba(255, 255, 255, .1); box-shadow: none; font-weight: 700; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn:focus-visible, input:focus-visible, .chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- ana menü ---------- */
.menu { position: fixed; inset: 0 auto 0 0; width: min(430px, 100%); padding: max(14px, env(safe-area-inset-top)) 22px max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; justify-content: center; gap: 11px; overflow-y: auto; touch-action: pan-y; background: linear-gradient(90deg, rgba(29, 20, 15, .94) 62%, rgba(29, 20, 15, 0)); }
.back { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 22px; color: var(--dim); text-decoration: none; font-weight: 700; font-size: 14px; }
.logo { margin: 18px 0 0; font-size: clamp(44px, 12.5vw, 66px); line-height: .9; font-weight: 800; letter-spacing: .01em; color: var(--red); transform: rotate(-3deg); text-shadow: 0 4px 0 #7a1f12, 0 8px 0 #120b07, 0 12px 22px rgba(0, 0, 0, .45); }
.logo span { display: block; color: var(--gold); text-shadow: 0 4px 0 #9c5a12, 0 8px 0 #120b07, 0 12px 22px rgba(0, 0, 0, .45); }
.tagline { margin: 4px 0; color: var(--dim); font-weight: 700; font-size: 17px; }
.courses { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; touch-action: pan-x; }
.courses::-webkit-scrollbar { display: none; }
.chip { flex: 1 0 auto; min-width: 86px; padding: 7px 10px 5px; border-radius: 14px; border: 2px solid transparent; background: rgba(255, 255, 255, .1); text-align: center; cursor: pointer; line-height: 1.15; }
.chip b { display: block; font-size: 14.5px; font-weight: 800; white-space: nowrap; } .chip span { font-size: 21px; } .chip small { display: block; font-size: 12px; color: var(--dim); font-weight: 700; }
.chip.on { border-color: var(--gold); background: rgba(246, 185, 59, .2); } .chip.done small { color: var(--grn); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.joinrow { display: grid; grid-template-columns: 1fr 100px; gap: 9px; margin-top: 2px; }
input { min-height: 44px; padding: 3px 14px 0; border-radius: 14px; border: 2px solid var(--line); background: rgba(0, 0, 0, .3); font-weight: 800; font-size: 17px; user-select: text; -webkit-user-select: text; min-width: 0; }
#code, .codein { text-align: center; letter-spacing: .3em; text-transform: uppercase; } #code::placeholder, .codein::placeholder { letter-spacing: .08em; font-size: 14px; color: #a08d7b; }
#menuMsg { min-height: 20px; margin: 0; text-align: center; color: #ffb3a8; font-weight: 700; font-size: 14.5px; }
.fine { margin: 0; text-align: center; color: #a08d7b; font-size: 13px; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }

/* ---------- savaş göstergeleri ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
.top { position: absolute; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr 46px; align-items: start; gap: 10px; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); }
.side b { display: block; font-size: 15px; font-weight: 800; text-shadow: 0 2px 4px rgba(0, 0, 0, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .side.en { text-align: right; }
.hp { position: relative; height: 20px; border-radius: 10px; background: rgba(20, 12, 8, .75); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); overflow: hidden; }
.hp i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(180deg, #6ee7a0, #22c55e); transition: width .25s; } .side.en .hp i { inset: 0 0 0 auto; background: linear-gradient(180deg, #f98b7c, #dc2626); }
.hp span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); padding-top: 2px; }
.mid { display: flex; flex-direction: column; align-items: center; gap: 4px; } #hTime { padding: 1px 12px 0; border-radius: 10px; background: rgba(20, 12, 8, .75); font-weight: 800; font-variant-numeric: tabular-nums; } #hTime.heat { background: var(--red); }
#mini { width: min(30vw, 220px); height: 14px; border-radius: 7px; background: rgba(20, 12, 8, .75); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); pointer-events: auto; cursor: pointer; }
#hMenu { width: 42px; height: 38px; border: 0; border-radius: 12px; background: rgba(20, 12, 8, .75); font-size: 20px; font-weight: 800; pointer-events: auto; cursor: pointer; }
#hAlly { position: absolute; top: max(58px, calc(env(safe-area-inset-top) + 50px)); left: max(10px, env(safe-area-inset-left)); padding: 2px 12px 0; border-radius: 10px; background: rgba(20, 184, 166, .85); font-weight: 800; font-size: 14px; }
#hToast { position: absolute; top: 20%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#hToast div { padding: 4px 18px 1px; border-radius: 16px; background: rgba(20, 12, 8, .85); font-weight: 800; font-size: clamp(16px, 4.2vw, 23px); text-align: center; max-width: 92vw; animation: toast 3s forwards; }
#hToast div.good { background: rgba(34, 197, 94, .93); color: #062b14; } #hToast div.bad { background: rgba(229, 80, 57, .95); }
@keyframes toast { 0% { transform: scale(.5); opacity: 0; } 8% { transform: scale(1.1); opacity: 1; } 14% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(29, 20, 15, 0), rgba(29, 20, 15, .92) 26%); pointer-events: auto; }
.res { display: flex; align-items: center; gap: 12px; margin: 0 auto 6px; max-width: 760px; font-weight: 800; white-space: nowrap; }
#hGold { font-size: 23px; color: var(--gold); text-shadow: 0 2px 0 #5a3508; font-variant-numeric: tabular-nums; min-width: 96px; } #hPop { font-size: 15px; } #hQueue { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--dim); }
#hQueue i { width: 11px; height: 11px; border-radius: 3px; background: rgba(255, 255, 255, .22); } #hQueue i.on { background: var(--gold); } #hQueue u { width: 46px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .2); overflow: hidden; } #hQueue u b { display: block; height: 100%; background: var(--grn); }
.rps { margin-left: auto; font-size: 12.5px; color: var(--dim); font-weight: 700; }
.btns { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; max-width: 760px; margin: 0 auto; }
.ub { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 104px; padding: 2px 2px 4px; border: 0; border-radius: 14px; background: var(--b1); box-shadow: 0 4px 0 var(--b2); cursor: pointer; overflow: hidden; line-height: 1.1; transition: transform .08s, filter .15s; }
.ub:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--b2); } .ub.no { filter: grayscale(.75) brightness(.62); } .ub.shake { animation: shake .25s; } @keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.ub canvas { width: 58px; height: 58px; } .ub .em { font-size: 36px; height: 58px; display: grid; place-items: center; }
.ub b { font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } .ub small { font-size: 13px; font-weight: 800; color: var(--gold); }
.ub kbd { position: absolute; top: 3px; left: 6px; font: 800 11px/1 inherit; color: var(--dim); opacity: .8; } .ub em { position: absolute; top: 3px; right: 6px; font-style: normal; font-size: 13px; }
.ub .cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0, 0, 0, .58); pointer-events: none; }
.ub.age { background: linear-gradient(180deg, #ffd87a, var(--gold) 45%, var(--org)); color: #3a1c00; box-shadow: 0 4px 0 #9c5a12; } .ub.age small { color: #5a2c00; } .ub.age kbd { color: #5a2c00; } .ub.age.ready { animation: glow 1s ease-in-out infinite alternate; } @keyframes glow { to { filter: brightness(1.25); transform: translateY(-2px); } }
.ub.sp { background: #7a2a1e; box-shadow: 0 4px 0 #3d120b; } .ub.tur { background: #3f4a55; box-shadow: 0 4px 0 #1f262d; }
#net { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); padding: 6px 16px 3px; border-radius: 12px; background: var(--red); font-weight: 800; z-index: 50; }

/* ---------- pencereler ---------- */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 14px; background: rgba(12, 7, 4, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); touch-action: pan-y; }
.box { position: relative; width: min(440px, 100%); max-height: 100%; overflow-y: auto; padding: 20px 20px 18px; border-radius: 26px; background: var(--card); border: 2px solid var(--line); box-shadow: 0 24px 70px rgba(0, 0, 0, .55); text-align: center; display: flex; flex-direction: column; gap: 10px; animation: pop .35s cubic-bezier(.2, 1.5, .4, 1); }
.box > * { flex-shrink: 0; }
.box h2 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1; color: var(--gold); text-shadow: 0 3px 0 #9c5a12; } .box h2.lose { color: #f0735f; text-shadow: 0 3px 0 #7a1f12; }
.box h3 { margin: 4px 0 0; font-size: 15px; color: var(--dim); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.box p { margin: 0; } .box .dim { color: var(--dim); font-size: 14.5px; } .box a { color: var(--gold); font-weight: 800; }
.x { position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 12px; background: none; color: var(--dim); font-size: 22px; cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .stats.four { grid-template-columns: repeat(4, 1fr); }
.stats div { padding: 8px 4px 5px; border-radius: 16px; background: rgba(255, 255, 255, .09); line-height: 1.15; } .stats small { display: block; color: var(--dim); font-size: 12.5px; font-weight: 700; } .stats b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.say { font-size: 18px; font-weight: 700; line-height: 1.3; } .say b { color: var(--gold); }
.codebig { font-size: 50px; line-height: 1; font-weight: 800; letter-spacing: .12em; color: var(--gold); text-shadow: 0 4px 0 #9c5a12; user-select: all; -webkit-user-select: all; padding-left: .12em; }
.plist { display: flex; flex-direction: column; gap: 6px; } .plist div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 14px 3px; border-radius: 12px; background: rgba(255, 255, 255, .1); font-weight: 800; } .plist div.wait { opacity: .55; font-weight: 700; } .plist small { color: var(--dim); font-weight: 700; }
.share3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.note { padding: 8px 12px 6px; border-radius: 14px; background: rgba(255, 255, 255, .07); font-size: 14.5px; color: var(--dim); }
.how { text-align: left; margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 15.5px; } .how b { color: var(--gold); }
.ages { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; font-size: 13px; font-weight: 700; } .ages span { padding: 2px 9px 0; border-radius: 9px; background: rgba(255, 255, 255, .1); }

@media (max-width: 700px) {
  .menu { inset: 0; width: 100%; background: linear-gradient(180deg, rgba(29, 20, 15, .9), rgba(29, 20, 15, .66)); padding-left: max(22px, calc(50% - 200px)); padding-right: max(22px, calc(50% - 200px)); }
  .back { left: max(22px, calc(50% - 200px)); }
  .rps { display: none; } .ub { min-height: 86px; border-radius: 12px; } .ub canvas { width: 46px; height: 46px; } .ub .em { font-size: 28px; height: 46px; } .ub b { font-size: 10.5px; } .ub small { font-size: 12px; } .ub kbd { display: none; } .btns { gap: 5px; }
  #hGold { font-size: 20px; min-width: 80px; } .side b { font-size: 13px; }
}
@media (max-height: 640px) { .menu { justify-content: flex-start; gap: 8px; } .logo { font-size: 40px; margin-top: 22px; } .tagline, .fine { display: none; } .btn.xl { min-height: 56px; font-size: 24px; } .btn { min-height: 44px; } }
@media (max-height: 480px) { .ub { min-height: 62px; } .ub b { display: none; } .ub canvas { width: 34px; height: 34px; } .ub .em { height: 34px; font-size: 23px; } .res { margin-bottom: 3px; } #hToast { top: 16%; } }
