/* base.css — Avelith Okey Arena: temel değişkenler, tipografi, düğmeler, modallar, bildirimler */
:root {
    --bg: #1b120c;
    --bg2: #241811;
    --panel: rgba(36, 24, 17, 0.94);
    --panel2: #2f2016;
    --line: rgba(255, 220, 170, 0.14);
    --text: #f6ead6;
    --muted: #c6b08f;
    --gold: #e7b759;
    --gold2: #c8913a;
    --green: #3fbf74;
    --red: #e0574b;
    --blue: #5aa9ff;
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --radius: 14px;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
#stage { position: fixed; inset: 0; }
.stage-canvas { display: block; touch-action: none; }
#ui { position: fixed; inset: 0; overflow: auto; background: radial-gradient(1200px 700px at 50% -10%, #4a2c18 0%, #241811 45%, #140d08 100%); }
#hud { position: fixed; inset: 0; pointer-events: none; }

.btn { border: 1px solid var(--line); background: linear-gradient(#3b291c, #2b1d14); color: var(--text); padding: 9px 16px; border-radius: 10px; font-weight: 600; transition: transform .08s, filter .15s; }
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(#f0c46a, #c8913a); color: #2a1708; border-color: #f7d48e; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: transparent; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: #2a1c13; color: var(--muted); padding: 7px 12px; border-radius: 9px; font-weight: 600; }
.seg button.on { background: linear-gradient(#f0c46a, #c8913a); color: #2a1708; border-color: #f7d48e; }
.seg button:disabled { opacity: .4; }

.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 0; }
.toggle input { display: none; }
.toggle .sw { width: 38px; height: 22px; border-radius: 12px; background: #4a3628; position: relative; transition: background .2s; flex: none; }
.toggle .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #f6ead6; transition: transform .2s; }
.toggle input:checked + .sw { background: var(--green); }
.toggle input:checked + .sw::after { transform: translateX(16px); }

.form { display: grid; gap: 8px; }
.form label { color: var(--muted); font-size: 13px; margin-top: 6px; }
.form input, .form select, select, input[type=text], input[type=password], .form.inline input { background: #1d130d; border: 1px solid var(--line); color: var(--text); padding: 10px 12px; border-radius: 10px; font-size: 15px; outline: none; }
.form input:focus { border-color: var(--gold); }
.form.inline { display: flex; gap: 8px; }
.form.inline input { flex: 1; min-width: 0; }
.form .row, .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toggles { display: grid; gap: 4px; margin-top: 6px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }

.modal { position: fixed; inset: 0; background: rgba(8, 5, 3, 0.62); display: flex; align-items: center; justify-content: center; z-index: 50; pointer-events: auto; padding: max(10px, var(--safe-t)) max(10px, var(--safe-r)) max(10px, var(--safe-b)) max(10px, var(--safe-l)); animation: fade .15s; }
.mbox { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; width: min(440px, 100%); max-height: 100%; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal.wide .mbox { width: min(760px, 100%); }
.mhead { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mhead h3 { margin: 0; font-size: 17px; }
.mclose { background: none; border: 0; font-size: 18px; color: var(--muted); }
.mbody { padding: 14px 16px; overflow: auto; }
.mact { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; }
@keyframes fade { from { opacity: 0; } }

.toasts { position: fixed; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 60; pointer-events: none; align-items: center; }
.toast { background: rgba(30, 20, 13, .95); border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.4); transition: opacity .35s, transform .35s; max-width: 86vw; text-align: center; }
.toast.good { border-color: rgba(63,191,116,.6); }
.toast.bad { border-color: rgba(224,87,75,.7); }
.toast.out { opacity: 0; transform: translateY(-8px); }

#boot { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(800px 500px at 50% 30%, #4a2c18, #140d08); transition: opacity .5s; }
#boot.done { opacity: 0; pointer-events: none; }
#boot .logo { font-size: 26px; font-weight: 800; letter-spacing: .5px; color: var(--gold); }
.boot-tiles { display: flex; gap: 8px; }
.boot-tiles i { width: 44px; height: 62px; border-radius: 8px; background: linear-gradient(#fbf6ea, #e9dcc0); color: #c8322e; font: 900 30px/62px "Segoe UI", Arial; text-align: center; font-style: normal; box-shadow: 0 6px 14px rgba(0,0,0,.5); animation: bob 1.4s infinite ease-in-out; }
.boot-tiles i:nth-child(2) { color: #1565c0; animation-delay: .15s; }
.boot-tiles i:nth-child(3) { color: #d98e04; animation-delay: .3s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.progress { width: 220px; height: 6px; border-radius: 4px; background: #3a281b; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .3s; }
.sub { color: var(--muted); font-size: 13px; }

/* Telefon: dikey tutulunca yan çevir perdesi (zorunlu yatay) */
#rotate { display: none; }
body.phone.portrait #rotate { display: flex; position: fixed; inset: 0; z-index: 95; flex-direction: column; gap: 12px; align-items: center; justify-content: center; padding: 24px; text-align: center;
    background: radial-gradient(600px 500px at 50% 40%, #3a2416, #120c08); color: var(--text); }
#rotate .rot-ic { width: 92px; height: 92px; color: var(--gold); animation: rot 2.2s ease-in-out infinite; }
#rotate .rot-ic svg { width: 100%; height: 100%; }
#rotate b { font-size: 21px; }
#rotate span { color: var(--muted); font-size: 14px; max-width: 280px; }
#rotate .btn { margin-top: 8px; min-height: 46px; padding: 0 22px; font-size: 15px; }
@keyframes rot { 0%, 20% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
/* Oyunu kapat: yalnızca telefonda tam ekrandayken */
.fs-close { display: none; }
body.phone.fs .fs-close { display: flex; position: fixed; z-index: 90; top: calc(6px + var(--safe-t)); right: calc(6px + var(--safe-r)); width: 36px; height: 36px; border-radius: 50%; align-items: center; justify-content: center;
    border: 1px solid rgba(224,87,75,.55); background: rgba(60,18,14,.82); color: #ffb3aa; box-shadow: 0 4px 14px rgba(0,0,0,.45); backdrop-filter: blur(8px); }
.fs-close svg { width: 18px; height: 18px; }
.modal.fs-ask { z-index: 96; }
#closed-screen { position: fixed; inset: 0; z-index: 99; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; text-align: center; padding: 24px; background: #0f0a07; color: var(--text); }
#closed-screen b { font-size: 22px; } #closed-screen span { color: var(--muted); }

.tc-red { color: #ff6b5e; } .tc-black { color: #e9e2d6; } .tc-blue { color: #6ab4ff; } .tc-yellow { color: #f2b63a; } .tc-fake { color: #57c48c; }
.bot-tag { position: absolute; right: -4px; bottom: -4px; font-size: 8px; font-weight: 800; background: #3b82f6; color: #fff; padding: 1px 3px; border-radius: 4px; }
/* tipi belirtilmemiş giriş kutuları da temaya uysun (masa adı, arama vb.) */
input:not([type]), input[type=search], input[type=text], input[type=password], input[type=number] { background: #1d130d; border: 1px solid var(--line); color: var(--text); padding: 10px 12px; border-radius: 10px; font: inherit; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:not([type]):focus, input[type=search]:focus, input[type=text]:focus, input[type=password]:focus, input[type=number]:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231,183,89,.18); }
input::placeholder { color: rgba(198,176,143,.55); }

/* ---------- Nasıl Oynanır (adım adım tanıtım) ---------- */
.modal.tutorial { z-index: 90; background: rgba(8, 5, 3, 0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.tut-box { width: min(880px, 100%); overflow: hidden; border-color: rgba(231, 183, 89, .35); }
.tut-media { position: relative; aspect-ratio: 16 / 9; background: #0e1626; flex: none; overflow: hidden; }
.tut-img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transform: scale(1.015); transition: opacity .3s, transform .45s; }
.tut-img.in { opacity: 1; transform: none; }
.tut-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; }
.tut-body { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 8px; }
.tut-kicker { display: flex; justify-content: space-between; align-items: center; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); }
.tut-kicker .tut-count { color: var(--muted); letter-spacing: 0; text-transform: none; }
.tut-body h3 { margin: 0; font-size: 21px; }
.tut-body p { margin: 0; color: #e9dcc5; line-height: 1.5; font-size: 15px; min-height: 4.5em; }
.tut-dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 2px; }
.tut-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: rgba(255, 226, 180, .25); transition: width .2s, background .2s; }
.tut-dots button.on { width: 22px; background: var(--gold); }
.tut-act { display: flex; gap: 8px; align-items: center; }
.tut-act .tut-sp { flex: 1; }
.tut-act .btn.primary { min-width: 96px; }
.tut-skip { color: var(--muted); }
/* yatay telefon: görsel solda, metin sağda */
@media (max-height: 520px) and (min-aspect-ratio: 4/3) {
    .tut-box { flex-direction: row; width: min(860px, 100%); max-height: 100%; }
    .tut-media { width: 56%; aspect-ratio: auto; height: auto; }
    .tut-body { width: 44%; padding: 12px 14px; gap: 6px; overflow-y: auto; }
    .tut-body h3 { font-size: 17px; }
    .tut-body p { font-size: 13px; min-height: 0; }
    .tut-act .btn { padding: 7px 11px; font-size: 13px; }
    .tut-act { flex-wrap: wrap; }
}
@media (max-width: 520px) { .tut-body p { font-size: 14px; } .tut-act .btn { padding: 8px 11px; } }
