:root {
    --bg1: #0f1226;
    --bg2: #1b1f3a;
    --accent: #7c5cff;
    --accent-2: #25d0a6;
    --text: #e9ecf1;
    --muted: #a7afc3;
    --shadow: 0 20px 50px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .04);
    --card-max: 760px;
    --safe-vw: 4vw;
    --stage-offset-y: 72px;
}

@font-face {
    font-family: 'Gerycliff Tr Heavy';
    src: local('Gerycliff Tr Heavy'), local('GerycliffTr-Heavy');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

*::-webkit-scrollbar {
    display: none;
}

body {
    color: var(--text);
    font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    position: relative;
    background: #3943b3;
}

.bg-video {
    position: fixed;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #3943b3;
    pointer-events: none;
}

.wrap {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 0 0 16px;
    position: relative;
}

.card {
    width: min(94vw, var(--card-max));
    background: transparent;
    border-radius: 24px;
    box-shadow: none;
    padding: 22px 18px 26px;
    position: relative;
    border: 0;
    z-index: 2;
    transition: transform .25s ease;
}

.header {
    padding: 4px 8px 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.stealth-fs {
    appearance: none;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    padding: 0;
    margin: 0;
    font-weight: 800;
    font-size: clamp(18px, 2.6vw, 26px);
    letter-spacing: .3px;
    cursor: pointer;
    display: inline-block;
}

.ring-text {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.ring-text text {
    fill: #e9ecf1;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial;
    font-weight: 900;
    font-size: 6px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.stealth-fs:focus-visible {
    outline: 2px dashed #ffffff66;
    outline-offset: 3px;
}

.hint {
    color: var(--muted);
    font-size: 13px;
}

.settings-panel #stockSummary {
    font-weight: 800;
}

.stage {
    position: relative;
    aspect-ratio: 1/1;
    width: min(90vmin, 680px);
    margin: auto;
    margin-top: clamp(250px, 30vh, 310px);
    display: grid;
    place-items: center;
    isolation: isolate;
    transform: translateY(var(--stage-offset-y));
}

/* Sol üst Decathlon logosu (çarkla birlikte hareket eder) */
/* logo yukarı ve sola ayarı*/
.brand-logo {
    position: absolute;
    top: -240px;
    left: -48px;
    z-index: 7;
    pointer-events: none;
}

.brand-logo-img {
    width: clamp(360px, 48vmin, 560px);
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .25));
}

/* Çark/QR arkasında ortalanmış görsel katmanı */
.center-bg {
    position: absolute;
    inset: 6% 6%;
    z-index: 0;
    /* canvas(1) altında, stage::before(0) ile aynı seviyede bırakabiliriz */
    display: grid;
    place-items: center;
    pointer-events: none;
    border-radius: 50%;
    overflow: hidden;
}

.center-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    opacity: 1;
}

/* QR öğeleri kaldırıldı */

.title-overlay {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 7;
    pointer-events: auto;
}

.settings-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 6;
    border: 0;
    background: transparent;
    color: #fff;
    border-radius: 12px;
    padding: 8px 12px;
    font-weight: 700;
    font-size: clamp(34px, 4.4vw, 42px);
    line-height: 1;
    cursor: pointer;
    backdrop-filter: none;
}



.settings-btn:focus-visible {
    outline: 2px dashed #ffffff66;
    outline-offset: 3px;
}

.settings-panel {
    position: absolute;
    top: 46px;
    right: 8px;
    z-index: 6;
    width: min(72vw, 240px);
    background: linear-gradient(180deg, #1d2aa0, #0e1a7a);
    border: 1px solid #ffffff10;
    border-radius: 12px;
    padding: 12px;
    box-shadow: none;
    display: none;
}

.settings-panel.show {
    display: block;
}

.settings-panel h3 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 800;
    color: #e9ecf1;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text);
}

.settings-panel .btn-inline {
    border: 1px solid #4b57d1;
    cursor: pointer;
    border-radius: 10px;
    padding: 8px 10px;
    font-weight: 700;
    background: #3943b3;
    color: #fff;
    box-shadow: 0 2px 8px rgba(57, 67, 179, 0.35);
}

#fsToggle {
    background: #3943b3;
    color: #fff;
    border: 1px solid #4b57d1;
    box-shadow: 0 2px 8px rgba(57, 67, 179, 0.35);
}

/* Genel Ses kaydırma çubuğu rengi */
#masterVolume {
    accent-color: #4b57d1;
}

/* Müzik ayarı kaldırıldı */

#autoCloseToggle {
    accent-color: #4b57d1;
}

/* Dikey Konum slider'ını sarı yap */
#stageOffsetY {
    accent-color: #4b57d1;
}

.settings-hidden .settings-btn {
    opacity: 0;
    pointer-events: none;
}

.stage::before {
    content: "";
    position: absolute;
    inset: 6% 6%;
    border-radius: 50%;
    box-shadow: 0 35px 90px rgba(0, 0, 0, .45), inset 0 0 0 1px #ffffff10;
    z-index: 0;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    z-index: 1;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .35));
}

.pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    z-index: 5;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 32px solid #fff;
}

.pointer::after {
    content: "";
    position: absolute;
    left: -10px;
    top: -36px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #aab4ff, #6e7cff 70%, #4b57d1 100%);
    box-shadow: 0 0 12px #6e7cff, 0 0 30px rgba(78, 88, 209, 0.5);
}

.center-wrap {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 3;
    pointer-events: none;
}

.hub {
    pointer-events: auto;
    display: grid;
    place-items: center;
    width: min(34%, 240px);
    aspect-ratio: 1/1;
    border-radius: 50%;
    position: relative;
}

.spin-img {
    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    z-index: 2;
    transition: none;
    box-shadow: none;
}

.spin-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    pointer-events: none;
    user-select: none;
    filter: none;
    display: none;
}

/* Merkezde kılcal çizgi oluşmasını engelle */
.hub,
.spin-img {
    border: 0;
    outline: none;
    background: transparent;
    box-shadow: none;
}

.spin-img:hover {
    transform: none;
    filter: none;
}

.spin-img:active {
    transform: none;
}

.spin-img:focus,
.spin-img:focus-visible {
    outline: none;
}

.spin-img[disabled] {
    opacity: 1;
    cursor: not-allowed;
    filter: none;
    box-shadow: none;
}

.spin-img::before {
    content: none;
}

.subnote {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
    text-align: center;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: start;
    justify-items: center;
    z-index: 99;
    background: rgba(7, 9, 20, .55);
    backdrop-filter: none;
    padding: 4vw;
}

.modal.show {
    display: grid;
}

.modal-card {
    width: 100%;
    max-width: 560px;
    background: linear-gradient(180deg, #1d2aa0, #0e1a7a);
    border: 1px solid #ffffff10;
    border-radius: 20px;
    padding: clamp(12px, 3.2vw, 22px);
    box-shadow: none;
    text-align: center;
    max-height: 86vh;
    display: grid;
    align-content: center;
    gap: clamp(6px, 2vw, 14px);
    margin-top: clamp(20vh, 24vh, 28vh);
    transform: none;
}

/* PIN Modal stilleri */
.pin-input-wrap {
    display: grid;
    place-items: center;
}

.pin-field {
    text-align: center;
    font-weight: 900;
    letter-spacing: 6px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #4b57d1;
    background: #0e1a7a;
    color: #fff;
    width: 160px;
}

.stock-list {
    display: grid;
    gap: 8px;
    margin: 10px 0 2px;
    text-align: left;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(78, 88, 209, 0.15);
    color: #e9ecf1;
}

.stock-item .label {
    font-weight: 800;
}

.stock-item .qty {
    font-weight: 700;
}

.stock-total {
    margin-top: 6px;
    text-align: right;
    font-weight: 800;
    color: #e9ecf1;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(4, minmax(56px, 1fr));
    grid-template-rows: repeat(4, auto);
    gap: 10px;
    justify-items: stretch;
}

.pad {
    border: 0;
    border-radius: 12px;
    padding: 12px 0;
    font-weight: 800;
    background: #3943b3;
    color: #fff;
    box-shadow: 0 2px 8px rgba(57, 67, 179, 0.35);
}

/* Yerleşim: 4 sütunlu düzen
   1  2  3  OK
   4  5  6  OK
   7  8  9  OK
   Del 0  (boş) OK */
.pad:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.pad:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.pad:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
}

.pad:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
}

.pad:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
}

.pad:nth-child(6) {
    grid-column: 3;
    grid-row: 2;
}

.pad:nth-child(7) {
    grid-column: 1;
    grid-row: 3;
}

.pad:nth-child(8) {
    grid-column: 2;
    grid-row: 3;
}

.pad:nth-child(9) {
    grid-column: 3;
    grid-row: 3;
}

.pad.pad-del {
    grid-column: 1 / span 1;
    grid-row: 4;
}

.pad[data-key="0"] {
    grid-column: 2;
    grid-row: 4;
}

.pad.pad-ok {
    grid-column: 4;
    grid-row: 1 / span 4;
    align-self: stretch;
}

/* Renkler: sil=hafif kırmızı, onay=hafif yeşil, iptal=hafif sarı */
.pad.pad-del {
    background: #b74141;
}

.pad.pad-ok {
    background: #2f8f5b;
}

.btn.btn-cancel {
    background: #b39b32;
}

.modal-card h2 {
    margin: 0;
    font-size: clamp(20px, 4vw, 28px);
    line-height: 1.2;
}

.prize {
    font-weight: 900;
    font-size: clamp(24px, 6.8vw, 40px);
    margin: 6px 0 8px;
    color: #eaf0ff;
    text-shadow: none;
    word-break: break-word;
}

.actions {
    display: flex;
    gap: clamp(8px, 2vw, 14px);
    justify-content: center;
    margin-top: 4px;
    flex-wrap: wrap;
}

.auto-close {
    margin-top: 8px;
}

.auto-close[aria-hidden="true"] {
    display: none;
}

.bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(78, 88, 209, 0.25);
    border-radius: 999px;
    overflow: hidden;
}

.bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #6e7cff, #4b57d1);
    transition: width linear 3s;
}

.btn {
    border: 0;
    cursor: pointer;
    border-radius: 12px;
    padding: clamp(10px, 2.6vw, 14px) clamp(12px, 3vw, 18px);
    font-weight: 700;
    background: #3943b3;
    color: #fff;
    font-size: clamp(14px, 3.2vw, 16px);
    box-shadow: 0 4px 12px rgba(57, 67, 179, 0.35);
}

/* Sonuç modalındaki Kapat butonunu bir tık büyüt */
#closeModal.btn {
    padding: clamp(14px, 3.6vw, 20px) clamp(16px, 4vw, 26px);
    font-size: clamp(20px, 4.6vw, 22px);
}

.btn.primary {
    background: linear-gradient(180deg, #6e7cff, #4b57d1 60%, #3943b3);
    box-shadow: 0 8px 20px rgba(57, 67, 179, 0.45), inset 0 -1px 0 rgba(0, 0, 0, .2);
}

.btn.btn-danger {
    background: #b74141;
}

.fullscreen .card {
    transform: scale(0.96);
    animation: fsPop 220ms ease-out;
}

@keyframes fsPop {
    from {
        transform: scale(0.92);
    }

    to {
        transform: scale(0.96);
    }
}

@media (max-width:420px) {
    .stage {
        margin-top: clamp(195px, 24.5vh, 225px);
    }

    /* QR öğeleri kaldırıldı */

    .deco-left,
    .deco-right {
        width: 24vw;
    }
}

@media (max-width:320px) {
    .stage {
        margin-top: clamp(200px, 23vh, 215px);
    }

    /* QR öğeleri kaldırıldı */
}