/* ANKARA'NIN İZLERİ - TİHEK Çocuk */
:root {
    --zemin: #0b3b3d;
    --zemin-koyu: #072a2c;
    --parsomen: #fdd28a;
    --parsomen-acik: #ffe6b5;
    --murekkep: #2b2321;
    --kirmizi: #f04a1c;
    --sari: #fcc66c;
    --yesil: #3aa66a;
    --lacivert: #1a4592;
    --mavi: #6aaad6;
    --pembe: #f07a92;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    color: var(--murekkep);
    background-color: var(--zemin);
    background-image:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 22px 22px;
}

/* EKRANLAR */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }
.screen-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    position: relative;
}
.screen-inner.center { justify-content: center; min-height: 100vh; }

.corner-logo { position: absolute; left: 8px; top: 10px; width: 110px; }
.title-banner { width: min(560px, 80%); margin-top: 20px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.title-banner.small { width: min(420px, 75%); margin-top: 6px; }

.parchment {
    background: var(--parsomen);
    border-radius: 6px;
    padding: 22px 28px;
    box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 0 40px rgba(160,100,30,.25);
    position: relative;
    width: 100%;
}
.parchment h2 {
    margin: 0 0 12px;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.parchment h3 { margin: 16px 0 6px; font-size: 1.15rem; color: #7a2d10; }
.story p { font-size: 1.08rem; line-height: 1.55; margin: 0 0 10px; text-align: justify; }
.story-end { text-align: center !important; font-weight: 700; font-size: 1.25rem !important; color: #7a2d10; }
.rules ul { margin: 0; padding-left: 22px; line-height: 1.5; }
.rules li { margin-bottom: 4px; }

.rule-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.rule-card {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--parsomen-acik);
    border-radius: 10px; padding: 10px 12px; line-height: 1.4; font-size: .95rem;
}
.sq {
    flex: 0 0 52px; height: 52px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem;
}
.sq-num { background: var(--sari); }
.sq-num::before { content: ''; }
.sq-logo { background: var(--mavi); }
.sq-logo img { width: 44px; }
.sq-star { background: var(--lacivert); color: #ffd23f; font-size: 2rem; }
.sq-bridge { background: var(--yesil); font-size: 1.8rem; }

.screen-title { color: #fff; font-size: 2rem; margin: 10px 0 0; text-align: center; }
.screen-hint { color: var(--parsomen); margin: 0; text-align: center; }

/* BUTONLAR */
.btn {
    font-family: inherit;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    padding: 12px 28px;
    cursor: pointer;
    color: #fff;
    background: var(--kirmizi);
    box-shadow: 0 5px 0 #a8300f, 0 8px 16px rgba(0,0,0,.3);
    transition: transform .1s, box-shadow .1s, filter .2s;
    letter-spacing: .5px;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #a8300f, 0 3px 6px rgba(0,0,0,.3); }
.btn:disabled { filter: grayscale(.7) brightness(.85); cursor: not-allowed; transform: none; }
.btn-big { font-size: 1.4rem; padding: 16px 46px; }
.btn-small { font-size: .95rem; padding: 9px 16px; }
.btn-ghost { background: var(--mavi); box-shadow: 0 5px 0 #3d7aa5, 0 8px 16px rgba(0,0,0,.3); }
.btn-green { background: var(--yesil); box-shadow: 0 5px 0 #23744a, 0 8px 16px rgba(0,0,0,.3); }
.btn-blue { background: var(--lacivert); box-shadow: 0 5px 0 #0e2a5e, 0 8px 16px rgba(0,0,0,.3); }
.btn-yellow { background: var(--sari); color: var(--murekkep); box-shadow: 0 5px 0 #c48d34, 0 8px 16px rgba(0,0,0,.3); }
.btn-round { width: 96px; height: 96px; font-size: 2.4rem; padding: 0; border-radius: 50%; }

.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.count-btns { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }

/* PİYON SEÇİMİ */
.name-input {
    font-family: inherit; font-size: 1.1rem;
    padding: 10px 18px; border-radius: 30px; border: 3px solid var(--parsomen);
    background: #fff; width: min(320px, 90%); text-align: center;
}
.pawn-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.pawn-option {
    width: 150px; padding: 12px 10px 10px;
    background: var(--parsomen); border-radius: 18px;
    border: 4px solid transparent;
    cursor: pointer; text-align: center;
    transition: transform .15s, border-color .15s;
    font-family: inherit; font-size: 1rem; font-weight: 600; color: var(--murekkep);
}
.pawn-option:hover:not(:disabled) { transform: translateY(-6px); border-color: #fff; }
.pawn-option img { height: 100px; width: 100%; object-fit: contain; display: block; margin-bottom: 6px; }
.pawn-option:disabled { opacity: .35; cursor: not-allowed; }
.pawn-option .taken { display: block; font-size: .85rem; color: #7a2d10; }

/* OYUN EKRANI */
.game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 14px;
    padding: 12px;
    min-height: 100vh;
    align-items: start;
    align-content: start;
}
.board-area { display: flex; justify-content: center; }
#board {
    position: relative;
    width: min(100%, calc((100vh - 24px) * 1.779));
    aspect-ratio: 2400 / 1349;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.board-img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
#pawns-layer { position: absolute; inset: 0; pointer-events: none; }

/* Piyon: oyuncu renginde rozet + figür */
.pawn {
    position: absolute;
    width: 5.2%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    transition: left .28s ease-in-out, top .28s ease-in-out;
    z-index: 2;
}
.pawn.teleport { transition: left .9s cubic-bezier(.5,-0.3,.5,1.3), top .9s cubic-bezier(.5,-0.3,.5,1.3); }
.pawn .base {
    position: absolute; inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff 0 18%, var(--renk) 60%);
    border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,.65);
}
.pawn img {
    position: absolute; left: 10%; top: 6%; width: 80%; height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,.6));
}
.pawn.active { z-index: 5; animation: hop 1s infinite; }
.pawn.active .base { box-shadow: 0 0 0 3px var(--renk), 0 0 16px 6px #fff; }
@keyframes hop { 0%,100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, -68%); } }
@keyframes zipla { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14%); } }

/* YAN PANEL */
.side-panel { display: flex; flex-direction: column; gap: 12px; }
.turn-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--parsomen); border-radius: 16px; padding: 10px 14px;
    border-left: 10px solid var(--renk, var(--kirmizi));
}
.turn-pawn img { width: 56px; height: 56px; object-fit: contain; display: block; }
.turn-label { font-size: .85rem; color: #7a2d10; font-weight: 600; text-transform: uppercase; }
.turn-name { font-size: 1.35rem; font-weight: 700; }

.wheel-box {
    background: rgba(255,255,255,.06); border-radius: 16px; padding: 14px 10px;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.wheel-wrap { position: relative; width: 190px; aspect-ratio: 1; padding-top: 16px; }
.wheel {
    width: 100%; height: 100%; object-fit: contain; display: block;
    transition: transform 3.6s cubic-bezier(.15,.85,.25,1);
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.4));
}
.wheel-pointer {
    position: absolute; left: 50%; top: -16px;
    width: 52px; transform: translateX(-50%) rotate(90deg);
    z-index: 2; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5));
}
.status-line { color: #fff; text-align: center; font-weight: 500; min-height: 1.4em; padding: 0 6px; }

.decks { display: flex; gap: 10px; justify-content: center; }
.deck { text-align: center; color: var(--parsomen); font-size: .85rem; font-weight: 600; }
.deck img { width: 64px; border-radius: 6px; display: block; margin: 0 auto 4px; box-shadow: 3px 3px 0 rgba(0,0,0,.35), 6px 6px 0 rgba(0,0,0,.2); }

.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.player-list li {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,.08); color: #fff;
    border-radius: 12px; padding: 6px 10px;
    border-left: 6px solid var(--renk);
}
.player-list li.active { background: rgba(253,210,138,.25); }
.player-list img { width: 32px; height: 32px; object-fit: contain; }
.player-list .pname { flex: 1; font-weight: 600; }
.player-list .ppos { font-size: .85rem; opacity: .85; }

.panel-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* MODAL */
.modal {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(4,20,22,.78);
    display: none; align-items: center; justify-content: center;
    padding: 16px;
}
.modal.open { display: flex; }
.modal-box {
    background: var(--parsomen);
    border-radius: 18px;
    width: min(560px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 22px 22px 24px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,.5);
    animation: pop .25s ease-out;
    border-top: 12px solid var(--vurgu, var(--kirmizi));
}
.modal-box.wide { width: min(820px, 100%); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-box h2 { margin: 0 0 8px; font-size: 1.9rem; }
.modal-box p { font-size: 1.12rem; line-height: 1.5; margin: 8px 0; }
.modal-icon { font-size: 3.4rem; line-height: 1; margin-bottom: 4px; }
.modal-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.modal-who { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; vertical-align: middle; }
.modal-who img { width: 40px; height: 40px; object-fit: contain; }

.good { --vurgu: var(--yesil); }
.bad { --vurgu: var(--kirmizi); }
.info { --vurgu: var(--lacivert); }
.star { --vurgu: #f6b500; }

/* KARTLAR */
.card-view { position: relative; width: min(300px, 70vw); margin: 10px auto 0; }
.card-view img { width: 100%; display: block; border-radius: 12px; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.answer-cover {
    position: absolute; left: 6%; right: 6%; top: 57%; height: 32%;
    background: repeating-linear-gradient(45deg, #8f2410, #8f2410 12px, #a32c14 12px, #a32c14 24px);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--parsomen); font-weight: 700; font-size: 1.1rem;
    transition: opacity .4s;
}
.answer-cover.hidden { opacity: 0; pointer-events: none; }
.answer-text {
    background: #fff; border-radius: 12px; padding: 10px 14px; margin-top: 12px;
    font-weight: 600; font-size: 1.1rem; border-left: 8px solid var(--yesil); text-align: left;
}

/* ANLAT BAKALIM */
.friend-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 12px; }
.friend-btn {
    font-family: inherit; font-weight: 600; font-size: 1rem;
    background: #fff; border: 4px solid var(--renk); border-radius: 16px;
    padding: 8px 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
    min-width: 110px;
}
.friend-btn img { width: 56px; height: 56px; object-fit: contain; }
.friend-btn:hover { transform: translateY(-3px); }

.method-wheel-wrap { position: relative; width: 220px; margin: 14px auto 6px; padding-top: 16px; }
.method-wheel-wrap .wheel { transition-duration: 3s; }
.method-name {
    display: inline-block; font-size: 1.5rem; font-weight: 700;
    padding: 6px 18px; border-radius: 40px; color: #fff; margin-top: 6px;
}
.method-desc { font-size: 1rem !important; }

.peek-warning { background: #fff; border-radius: 12px; padding: 12px; font-weight: 600; }
.peek-warning .eyes { font-size: 2.6rem; display: block; }

.timer {
    width: 140px; height: 140px; margin: 10px auto;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; font-weight: 700;
    background: conic-gradient(var(--yesil) calc(var(--p) * 1%), rgba(0,0,0,.12) 0);
    position: relative;
}
.timer::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--parsomen); }
.timer span { position: relative; }
.timer.warn { background: conic-gradient(var(--kirmizi) calc(var(--p) * 1%), rgba(0,0,0,.12) 0); }
.timer.warn span { color: var(--kirmizi); animation: pulse .5s infinite; }

.draw-wrap { margin-top: 8px; }
.draw-wrap canvas {
    width: 100%; max-width: 520px; aspect-ratio: 3 / 2;
    background: #fff; border-radius: 12px; touch-action: none; cursor: crosshair;
    box-shadow: inset 0 0 0 3px var(--sari);
}

.winner-pawn {
    width: 150px; height: 150px; object-fit: contain; padding: 18px;
    border-radius: 50%; border: 5px solid #fff;
    background: radial-gradient(circle at 35% 30%, #fff 0 18%, var(--renk) 65%);
    box-shadow: 0 6px 16px rgba(0,0,0,.35);
    animation: zipla 1s infinite;
}
.confetti { position: fixed; top: -20px; font-size: 1.6rem; z-index: 101; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* MOBİL */
@media (max-width: 1000px) {
    .game-layout { grid-template-columns: 1fr; }
    #board { width: 100%; }
    .side-panel { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
    .turn-card, .panel-btns { grid-column: 1 / -1; }
    .wheel-box { grid-row: span 2; }
}
@media (max-width: 640px) {
    .side-panel { grid-template-columns: 1fr; }
    .wheel-box { grid-row: auto; }
    .rule-cards { grid-template-columns: 1fr; }
    .parchment { padding: 18px 16px; }
    .parchment h2 { font-size: 1.5rem; }
    .corner-logo { width: 70px; }
    .title-banner { margin-top: 50px; }
    .btn-round { width: 72px; height: 72px; font-size: 1.8rem; }
    .pawn-option { width: 130px; }
}
