* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── BACKGROUND ─── */
.bg-layer {
    position: fixed;
    inset: 0;
    background: url('assets/Web-Arkaplan-1920x1080.png') center center / cover no-repeat;
    z-index: 0;
}

@media (max-width: 768px) {
    .bg-layer {
        background-image: url('assets/Mobil-Arkaplan-1080x1920.png');
    }
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
}

/* ─── WRAPPER ─── */
.game-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 960px;
    max-height: 100vh;
    padding: 12px 16px;
}

/* ─── LOGO ─── */
.logo-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.logo {
    width: clamp(70px, 10vw, 130px);
    height: clamp(70px, 10vw, 130px);
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.6));
}

/* ─── TABLE ─── */
.table-wrap {
    position: relative;
    width: 100%;
    max-width: 960px;
    /* Masanın en-boy oranını koru (2000x1000) */
    aspect-ratio: 2 / 1;
    max-height: 55vh;
}

.table-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.7));
}

/* ─── CUPS AREA ─── */
.cups-area {
    position: absolute;
    top: 0;
    left: 6%;
    right: 6%;
    height: 35%;
    display: flex;
    align-items: flex-end;
    justify-content: space-evenly;
    pointer-events: none;
}

.cup-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

.cup-slot.selectable {
    pointer-events: all;
    cursor: pointer;
}

.cup-slot.selectable:hover .cup-img {
    filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.9)) brightness(1.15);
}

/* ─── CUP IMAGE ─── */
.cup-img {
    width: clamp(60px, 8.5vw, 115px);
    position: relative;
    z-index: 3;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.3s ease;
    transform-origin: bottom center;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Kaldırma animasyonu - bardak yukarı kalkar */
.cup-slot.lifting .cup-img {
    transform: translateY(-120%) !important;
}

/* ─── FLOATING DIAMOND ─── */
#floatingDiamond {
    position: absolute;
    z-index: 2;
    width: clamp(40px, 6vw, 80px);
    height: clamp(40px, 6vw, 80px);
    display: none;           /* JS ile gösterilir */
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transform: translateX(-50%); /* yatay ortalama */
    opacity: 0;
    transition: opacity 0.3s ease;
}

#floatingDiamond.visible {
    display: flex;
    opacity: 1;
}

.diamond-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: float 1.4s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(0, 200, 255, 0.8));
    pointer-events: none;
    -webkit-user-drag: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

/* ─── START BUTTON ─── */
.btn-wrap {
    margin-top: 6px;
}

.start-btn {
    background: linear-gradient(135deg, #f7c948, #e8a000);
    border: none;
    color: #1a0a00;
    font-size: clamp(14px, 2vw, 20px);
    font-weight: 800;
    letter-spacing: 2px;
    padding: 14px 44px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(247, 201, 72, 0.5), 0 0 0 3px rgba(247, 201, 72, 0.2);
    transition: transform 0.15s, box-shadow 0.15s;
    text-transform: uppercase;
}

.start-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 32px rgba(247, 201, 72, 0.7), 0 0 0 4px rgba(247, 201, 72, 0.3);
}

.start-btn:active {
    transform: scale(0.97);
}

.start-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* ─── MESSAGE BOX ─── */
.message-box {
    min-height: 30px;
    color: #fff;
    font-size: clamp(13px, 1.8vw, 18px);
    font-weight: 600;
    letter-spacing: 1px;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    transition: opacity 0.4s;
}

/* ─── MODALS ─── */
.reward-modal,
.fail-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.35s ease;
}

.reward-modal.hidden,
.fail-modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.reward-card,
.fail-card {
    background: linear-gradient(145deg, #1a1a3e, #0d0d25);
    border: 2px solid rgba(247, 201, 72, 0.5);
    border-radius: 24px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 0 60px rgba(247, 201, 72, 0.3), 0 20px 60px rgba(0,0,0,0.6);
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 480px;
    width: 92%;
}

.fail-card {
    border-color: rgba(255, 80, 80, 0.5);
    box-shadow: 0 0 60px rgba(255, 80, 80, 0.2), 0 20px 60px rgba(0,0,0,0.6);
}

@keyframes popIn {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.reward-sparkles {
    font-size: 36px;
    animation: spin 2s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0%   { transform: rotate(0deg)   scale(1); }
    50%  { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

.reward-title {
    font-size: 28px;
    font-weight: 900;
    color: #f7c948;
    text-shadow: 0 0 20px rgba(247, 201, 72, 0.7);
    margin: 10px 0 6px;
    letter-spacing: 3px;
}

.reward-sub {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.reward-amount {
    font-size: clamp(22px, 4vw, 38px);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 30px rgba(0, 200, 255, 0.8), 0 0 60px rgba(0, 200, 255, 0.4);
    margin: 8px 0 16px;
    letter-spacing: 2px;
}

.reward-description {
    display: none;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    text-align: left;
    font-size: 13px;
    line-height: 1.7;
    color: #ccc;
    max-height: 180px;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
    white-space: pre-line;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.reward-description::-webkit-scrollbar { width: 4px; }
.reward-description::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 4px; }
.reward-description.visible { display: block; }

.fail-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.fail-title {
    font-size: 24px;
    font-weight: 800;
    color: #ff5050;
    text-shadow: 0 0 16px rgba(255, 80, 80, 0.5);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.fail-sub {
    color: #bbb;
    font-size: 14px;
    margin-bottom: 24px;
}

.play-again-btn {
    background: linear-gradient(135deg, #f7c948, #e8a000);
    border: none;
    color: #1a0a00;
    font-size: 16px;
    font-weight: 800;
    padding: 12px 36px;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(247, 201, 72, 0.4);
}

.play-again-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 24px rgba(247, 201, 72, 0.6);
}

/* ─── CUP POSITION TRANSITION (for shuffle) ─── */
.cup-slot {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Selected cup glow */
.cup-slot.selected .cup-img {
    filter: drop-shadow(0 0 18px rgba(255, 215, 0, 1)) brightness(1.2);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .cups-area {
        top: 40%;
        left: 2%;
        right: 2%;
        bottom: 8%;
    }
    .cup-img {
        width: clamp(44px, 11vw, 80px);
    }
    .diamond-wrap {
        width: clamp(28px, 7vw, 55px);
        height: clamp(28px, 7vw, 55px);
    }
}

@media (max-width: 480px) {
    .logo { width: 70px; height: 70px; }
    .reward-card, .fail-card { padding: 28px 24px; }
    .cups-area {
        top: 42%;
        left: 0%;
        right: 0%;
        bottom: 6%;
    }
    .cup-img {
        width: clamp(38px, 12vw, 65px);
    }
    .diamond-wrap {
        width: clamp(24px, 8vw, 45px);
        height: clamp(24px, 8vw, 45px);
    }
}

/* ─── TOP CONTROLS (mute button) ─── */
.top-controls {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1100;
    display: flex;
    gap: 10px;
}

.ctrl-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(247, 201, 72, 0.6);
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    color: #f7c948;
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s, border-color 0.2s;
}

.ctrl-btn:hover {
    background: rgba(247, 201, 72, 0.15);
    border-color: #f7c948;
    transform: scale(1.08);
}

.ctrl-btn.muted {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.35);
}

/* ─── LIVES DISPLAY ─── */
.lives-display {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    border: 2px solid rgba(247, 201, 72, 0.4);
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #f7c948;
    letter-spacing: 0.5px;
}

.lives-label {
    opacity: 0.85;
    font-size: 13px;
}

.lives-hearts {
    display: flex;
    gap: 5px;
}

.life-heart {
    font-size: 18px;
    color: #f7c948;
    text-shadow: 0 0 8px rgba(247,201,72,0.6);
    transition: color 0.3s, text-shadow 0.3s, transform 0.2s;
}

.life-heart.lost {
    color: rgba(255,255,255,0.15);
    text-shadow: none;
    transform: scale(0.85);
}

/* ─── SOCIAL MEDIA PANEL ─── */
.social-panel {
    position: fixed;
    right: 16px;
    bottom: 80px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    text-decoration: none;
    border: 2px solid rgba(247, 201, 72, 0.7);
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    color: #f7c948;
    transition: transform 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.social-btn:hover {
    transform: scale(1.12) translateX(-4px);
    background: rgba(247,201,72,0.18);
    border-color: #f7c948;
    box-shadow: 0 4px 20px rgba(247,201,72,0.35);
}

.social-btn.social-nolink {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* Fail modal lives message */
.fail-lives {
    font-size: 14px;
    color: #f7c948;
    margin-bottom: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

@media (max-width: 480px) {
    .lives-display { font-size: 12px; padding: 6px 12px; }
    .life-heart { font-size: 16px; }
    .social-btn { width: 40px; height: 40px; font-size: 17px; }
    .ctrl-btn   { width: 38px; height: 38px; font-size: 15px; }
}
