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

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* Exit Fullscreen Button */
.exit-fullscreen {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 9999;
    display: none;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    font-weight: normal;
    line-height: 1;
}

.exit-fullscreen:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.exit-fullscreen:active {
    transform: scale(0.95);
}

.game-container {
    background: white;
    border-radius: 30px;
    padding: 30px 15px;
    width: 100%;
    box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 0 8px rgba(255, 255, 255, 0.1);
    position: relative;
    animation: slideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.start-screen {
    text-align: center;
    padding: 60px 20px;
}

.start-screen p {
    font-size: 2rem;
    color: black;
    margin-bottom: 40px;
    line-height: 1.6;
    font-weight: 500
}

.game-screen {
    display: none;
}

.game-screen.active {
    display: block;
}

/* Instruction Box */
.instruction-box {
    /*! background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); */
    /*! border-radius: 20px; */
    /*! padding: 25px; */
    margin-bottom: 30px;
    /*! border: 4px solid #667eea; */
}

.instruction-text {
    font-size: 26px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.4;
}

/* Sticker Displays */
#sticker-display-step1,
#sticker-display-final,
#sticker-display-review {
min-height: 200px;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: flex-end;
gap: 10px;
padding: 20px 10px;
border-radius: 20px;
border: 5px dashed #667eea;
background: rgba(102, 126, 234, 0.05);
margin-bottom: 20px;
}

.sticker {
    width: auto;
    transition: transform 0.3s ease;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.sticker-hundred,
.sticker-ten {
    height: 250px;
}

.sticker-one {
    height: 25px;
}

.ones-container {
    display: flex;
    gap: 5px;
    align-items: flex-end;
    margin-left: 0.5rem;
}

.ones-stack {
    display: flex;
    flex-direction: column-reverse;
    gap: 5px;
}

.tens-container {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    margin-left: 0.5rem;
}

/* Operation Buttons Display */
.operation-buttons-display,
.operation-buttons-review {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
    padding: 20px;
}

.btn-operation {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #333;
    font-size: 48px;
    font-weight: 700;
    padding: 35px 55px;
    min-width: 160px;
    border: none;
    border-radius: 20px;
    cursor: default;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
    animation: wiggle 0.5s ease;
    font-family: 'Fredoka', sans-serif;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

.btn-operation.add {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.btn-operation.subtract {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

/* Answer Input */
.answer-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.answer-input-box {
    text-align: center;
}

.answer-input {
    font-size: 72px;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    padding: 30px 40px;
    border: 5px solid #667eea;
    border-radius: 20px;
    text-align: center;
    width: 280px;
    max-width: 90%;
    background: white;
    color: #333;
    box-shadow: 0 4px 0 rgba(102, 126, 234, 0.3);
    cursor: default;
}

.answer-input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 6px 0 rgba(118, 75, 162, 0.3);
}

/* Number Pad */
.number-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 350px;
}

.num-btn {
    background: linear-gradient(135deg, #e0e7ff 0%, #cfd9ff 100%);
    color: #333;
    font-size: 48px;
    font-weight: 700;
    padding: 10px;
    border: 3px solid #667eea;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(102, 126, 234, 0.3);
    transition: all 0.1s ease;
    font-family: 'Fredoka', sans-serif;
    min-width: 100px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.num-btn:hover {
    background: linear-gradient(135deg, #cfd9ff 0%, #b8c5ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 rgba(102, 126, 234, 0.3);
}

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

.num-btn-backspace {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-color: #fcb69f;
    font-size: 40px;
}

.num-btn-backspace:hover {
    background: linear-gradient(135deg, #fcb69f 0%, #ff9a76 100%);
}

/* Success Overlay */
.sticker-overlay-container {
    position: relative;
    min-height: 300px;
}

.sticker-overlay-container #sticker-display-final {
    opacity: 0.3;
}

.success-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.success-title-overlay {
    font-size: 6rem;
    color: black;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    animation: bounce 0.8s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.result-number-overlay {
    font-size: 80px;
    font-weight: 700;
    color: #667eea;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.4);
}

.success-text {
    font-size: 28px;
    color: white;
    font-weight: 600;
}

/* Error Box */
.error-box {
    margin-bottom: 30px;
    text-align: center;
}

.error-title {
    font-size: 36px;
    color: #d84315;
    margin-bottom: 10px;
}

.error-text {
    font-size: 24px;
    color: #555;
    font-weight: 600;
    display: none
}

/* Result Display */
.result-display-inline {
    text-align: center;
}

.result-number {
    font-size: 64px;
    font-weight: 700;
    color: #667eea;
    text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.1);
}

.result-label {
    font-size: 28px;
    color: #555;
    margin-bottom: 10px;
    display: none
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 10px 0;
}

button {
    padding: 20px 45px;
    font-size: 26px;
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    cursor: pointer;
    border: none;
    border-radius: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    top: 0;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.btn-start {
    background: linear-gradient(135deg, #6dd5ed 0%, #2193b0 100%);
    color: white;
    font-size: 36px;
    padding: 30px 60px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.btn-ready {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-check {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-new {
    background: linear-gradient(135deg, #2dd45e 0%, #1db8a8 100%);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-retry {
    background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    color: black;
}

.hidden {
    display: none;
}

/* Custom Alert Styling */
.custom-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.custom-alert.active {
    display: flex;
}

.alert-box {
    background: white;
    padding: 40px;
    border-radius: 25px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.alert-box h3 {
    font-size: 36px;
    color: #667eea;
    margin-bottom: 20px;
    display: none
}

.alert-box p {
    font-size: 24px;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.5;
}

.alert-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.alert-btn {
    padding: 18px 35px;
    font-size: 22px;
    border-radius: 12px;
}

.alert-yes {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.alert-no {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

@media (max-width: 768px) {
    .game-container {
        padding: 30px 20px;
    }

    .instruction-text {
        font-size: 22px;
    }

    .success-title-overlay {
        font-size: 40px;
    }

    .result-number-overlay {
        font-size: 56px;
    }

    .btn-operation {
        font-size: 36px;
        padding: 25px 40px;
        min-width: 120px;
    }

    .answer-section {
        flex-direction: column;
        gap: 20px;
    }

    .answer-input {
        font-size: 56px;
        width: 250px;
        padding: 25px 30px;
    }

    .number-pad {
        max-width: 300px;
        gap: 12px;
    }

    .num-btn {
        font-size: 40px;
        min-width: 85px;
        min-height: 85px;
        padding: 20px;
    }

    .num-btn-backspace {
        font-size: 36px;
    }

    button {
        padding: 18px 35px;
        font-size: 22px;
    }

    .btn-start {
        font-size: 28px;
        padding: 25px 50px;
    }

    .sticker-hundred,
    .sticker-ten {
        height: 120px;
    }
}

/* Tablet optimization (typical tablets 768px-1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .game-container {
        padding: 25px 10px;
        max-width: 95%;
    }

    #sticker-display-step1,
    #sticker-display-final,
    #sticker-display-review {
    gap: 8px;
    padding: 15px 5px;
    }

    .sticker-hundred,
    .sticker-ten {
        height: 140px;
    }

    .tens-container {
        gap: 4px;
        margin-left: 0.3rem;
    }

    .ones-container {
        gap: 2px;
        margin-left: 0.3rem;
    }

    .instruction-text {
        font-size: 24px;
    }

    .btn-operation {
        font-size: 40px;
        padding: 28px 45px;
    }

    .answer-section {
        gap: 30px;
    }

    .answer-input {
        font-size: 64px;
    }

    .number-pad {
        gap: 12px;
    }

    .num-btn {
        font-size: 44px;
        min-width: 90px;
        min-height: 90px;
    }
}

@media (max-width: 480px) {
    .instruction-text {
        font-size: 20px;
    }

    .btn-operation {
        font-size: 32px;
        padding: 20px 30px;
    }

    .answer-input {
        font-size: 48px;
        width: 220px;
        padding: 20px 25px;
    }

    .number-pad {
        max-width: 260px;
        gap: 10px;
    }

    .num-btn {
        font-size: 36px;
        min-width: 75px;
        min-height: 75px;
        padding: 15px;
    }

    .num-btn-backspace {
        font-size: 32px;
    }
}





