/* GumboBall Manager Page Styles */
/* Adaptive strategy: flexbox + clamp() — no fixed-percentage section heights */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, rgb(165, 110, 148) 0%, rgb(145, 90, 128) 100%);
    font-family: 'Futura', 'Arial', sans-serif;
    color: rgb(255, 227, 59);
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    padding: max(env(safe-area-inset-top), 8px) max(env(safe-area-inset-right), 8px) max(env(safe-area-inset-bottom), 8px) max(env(safe-area-inset-left), 8px);
}

/* ─── Page-level layout ─── */
.manager-container {
    max-width: 600px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 1vmin, 8px);
}

/* ─── Page header ─── */
.header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 1.5vmin, 12px);
    flex-shrink: 0;
}

header {
    text-align: center;
    flex-shrink: 0;
}

header h1 {
    font-size: clamp(1.2rem, 3.5vmin, 1.8rem);
    color: rgb(255, 227, 59);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
}

/* ─── Buttons ─── */
.btn {
    padding: clamp(6px, 1.2vmin, 10px) clamp(14px, 3vmin, 24px);
    font-size: clamp(0.75rem, 2vmin, 0.95rem);
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background-color: rgb(255, 227, 59);
    color: rgb(165, 110, 148);
}

.btn-primary:hover {
    background-color: rgb(255, 237, 89);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: rgb(255, 227, 59);
    border: 2px solid rgb(255, 227, 59);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.btn-enter {
    background-color: #00cc00;
    color: white;
    width: 100%;
    padding: clamp(8px, 1.5vmin, 14px) clamp(20px, 5vmin, 40px);
    font-size: clamp(1rem, 2.5vmin, 1.4rem);
}

.btn-enter:hover:not(:disabled) {
    background-color: #00ff00;
}

.btn-enter:disabled {
    background-color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

/* ─── Game controls (bottom) ─── */
.game-controls {
    text-align: center;
    flex-shrink: 0;
}

/* ─── Dice Selector — the main flex area ─── */
.dice-selector {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: clamp(8px, 1.5vmin, 14px);
    backdrop-filter: blur(10px);
    flex: 1;
    /* Takes ALL remaining vertical space */
    min-height: 0;
    /* Allows flex shrinking */
    display: flex;
    flex-direction: column;
    gap: clamp(4px, 1vmin, 8px);
}

/* Top controls within dice selector */
.dice-selector-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* ─── Dice Grid — fills remaining space in selector ─── */
.dice-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(6px, 2vmin, 16px);
    flex: 1;
    min-height: 0;
    align-items: center;
}

.dice-row {
    display: flex;
    justify-content: center;
    gap: clamp(6px, 2vmin, 16px);
    flex: 1;
    min-height: 0;
    align-items: center;
    width: 100%;
}

.dice-item {
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.dice-item:active {
    transform: scale(0.95);
}

.die {
    width: clamp(50px, 18vmin, 120px);
    aspect-ratio: 1;
    background-color: rgb(255, 227, 59);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.8rem, 12vmin, 5rem);
    color: rgb(165, 110, 148);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    user-select: none;
}

.dice-item.selected .die {
    background-color: #00ff00;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

/* ─── Selected display row ─── */
.selected-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1vmin, 8px);
    font-size: clamp(1rem, 2.5vmin, 1.4rem);
    font-weight: bold;
    flex-shrink: 0;
    margin-bottom: 30px;
}

/* ─── Enter button row ─── */
.enter-btn-wrapper {
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.selected-die,
.selected-sum {
    width: clamp(30px, 6vmin, 55px);
    height: clamp(30px, 6vmin, 55px);
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgb(255, 227, 59);
    font-size: clamp(0.85rem, 2vmin, 1.2rem);
}

.plus,
.equals {
    font-size: clamp(0.9rem, 2vmin, 1.2rem);
}

/* ─── Game Status ─── */
.game-status {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: clamp(6px, 1vmin, 10px) clamp(10px, 2vmin, 14px);
    flex-shrink: 0;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: clamp(2px, 0.5vmin, 4px) 0;
    border-bottom: 1px solid rgba(255, 227, 59, 0.2);
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    font-weight: bold;
    font-size: clamp(0.7rem, 1.8vmin, 0.95rem);
}

.status-value {
    font-size: clamp(0.8rem, 2vmin, 1rem);
}

/* ─── Feedback Flash ─── */
.feedback-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 255, 0, 0);
    pointer-events: none;
    transition: background-color 0.3s ease;
    z-index: 1000;
}

.feedback-flash.success {
    background-color: rgba(0, 255, 0, 0.3);
    animation: flashSuccess 0.5s ease-in-out;
}

.feedback-flash.seven {
    background-color: rgba(255, 0, 0, 0.3);
    animation: flashSeven 0.5s ease-in-out;
}

@keyframes flashSuccess {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

@keyframes flashSeven {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

#endGameBtn {
    display: none;
}

/* ─── Single media query: layout mode only ─── */
@media (min-width: 768px) {
    .header-row {
        flex-direction: row;
        justify-content: space-between;
    }
}