/* 🏀 International Call In Sick Day - Basketball Shooting Game */

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

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
    background: linear-gradient(135deg, #FFE5CC 0%, #FFD4A3 50%, #FFC894 100%);
    background-size: 400% 400%;
    animation: backgroundShift 20s ease infinite;
    min-height: 100vh;
}

@keyframes backgroundShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 100%;
    height: 100vh;
    margin: 0 auto;
    position: relative;
}

/* ===== START SCREEN ===== */
.start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    height: 100vh;
    overflow-y: auto;
    animation: fadeIn 0.6s ease;
}

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

.game-title {
    font-size: 2.2em;
    color: #2D3142;
    text-shadow: 4px 4px 0px #FFE66D;
    margin-bottom: 10px;
    text-align: center;
    animation: titleBounce 2s ease infinite;
}

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

.game-subtitle {
    font-size: 1.2em;
    color: #E63946;
    text-shadow: 2px 2px 0px #FFD4A3;
    margin-bottom: 20px;
    text-align: center;
}

.story-box {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    border: 5px solid #2D3142;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    max-width: 500px;
    box-shadow: 0 8px 0 #2D3142;
}

.story-text {
    color: white;
    font-size: 1.1em;
    line-height: 1.8;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
    text-align: center;
}

.game-info {
    background: white;
    border: 5px solid #2D3142;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    max-width: 500px;
    box-shadow: 0 8px 0 #2D3142;
}

.game-info h2 {
    font-size: 1.5em;
    color: #2D3142;
    text-shadow: 2px 2px 0px #FFE66D;
    margin-bottom: 15px;
    text-align: center;
}

.rules-list {
    list-style: none;
}

.rules-list li {
    font-size: 1em;
    color: #2D3142;
    padding: 10px;
    margin-bottom: 8px;
    background: #FFF9E6;
    border: 3px solid #2D3142;
    border-radius: 8px;
    line-height: 1.5;
}

.rules-list li strong {
    color: #E63946;
}

.name-input-section {
    margin-bottom: 20px;
    width: 100%;
    max-width: 350px;
}

#playerNameInput {
    width: 100%;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
    font-size: 1.3em;
    padding: 12px 20px;
    border: 4px solid #2D3142;
    border-radius: 12px;
    text-align: center;
}

#playerNameInput:focus {
    outline: none;
    border-color: #FF6B35;
}

/* Buttons */
.btn {
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
    font-size: 1.3em;
    font-weight: bold;
    padding: 15px 35px;
    border: 4px solid #2D3142;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.1s ease;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.2);
    margin: 8px;
    max-width: 350px;
    width: 100%;
}

.btn-start {
    background: linear-gradient(135deg, #26C485 0%, #1DA777 100%);
    color: white;
    box-shadow: 0 6px 0 #167A57;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #167A57;
}

.btn-start:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #167A57;
}

.btn-leaderboard {
    background: linear-gradient(135deg, #FFE66D 0%, #FDC830 100%);
    color: #2D3142;
    box-shadow: 0 6px 0 #CCA728;
}

.btn-leaderboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #CCA728;
}

.btn-leaderboard:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #CCA728;
}

.btn-primary {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A8A3 100%);
    color: white;
    box-shadow: 0 6px 0 #2D7A77;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #2D7A77;
}

.btn-primary:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #2D7A77;
}

.btn-secondary {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    color: white;
    box-shadow: 0 6px 0 #C85A28;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #C85A28;
}

.btn-secondary:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #C85A28;
}

/* ===== GAME SCREEN ===== */
.game-screen {
    display: none;
    flex-direction: column;
    height: 100vh;
}

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

.game-header {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: white;
    border-bottom: 5px solid #2D3142;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-icon {
    font-size: 1.8em;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #E63946;
    text-shadow: 2px 2px 0px #FFE66D;
}

/* ===== GAME CANVAS ===== */
.game-canvas {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #E8F5FF 0%, #D4E9F7 100%);
    touch-action: none;
}

.room-bg {
    position: absolute;
    width: 100%;
    height: 100%;
}

.room-decoration {
    position: absolute;
    font-size: 3em;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

.room-decoration:nth-child(1) {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.room-decoration:nth-child(2) {
    top: 60%;
    right: 10%;
    animation-delay: 1s;
}

.room-decoration:nth-child(3) {
    bottom: 15%;
    left: 15%;
    animation-delay: 2s;
}

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

/* Basket */
.basket {
    position: absolute;
    width: 120px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.basket-rim {
    font-size: 5em;
    filter: drop-shadow(3px 3px 5px rgba(0,0,0,0.3));
}

.basket-label {
    font-size: 0.8em;
    color: #2D3142;
    font-weight: bold;
    margin-top: -10px;
}

.basket.hit {
    animation: basketHit 0.3s ease;
}

@keyframes basketHit {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(5deg); }
}

/* Ball */
.ball {
    position: absolute;
    width: 60px;
    height: 60px;
    font-size: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.1s ease;
    z-index: 10;
    touch-action: none;
}

/* Larger touch area for mobile */
.ball::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.ball:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.ball.flying {
    cursor: default;
    transition: none;
}

.ball.spinning {
    animation: spin 0.5s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Trajectory Guide */
.trajectory-guide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Score Popup */
.score-popup {
    position: absolute;
    font-size: 2em;
    font-weight: bold;
    color: #26C485;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
    pointer-events: none;
    opacity: 0;
    z-index: 20;
}

.score-popup.show {
    animation: scorePopup 1s ease-out forwards;
}

@keyframes scorePopup {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5);
    }
    50% {
        transform: translateY(-30px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(1);
    }
}

/* Combo Display */
.combo-display {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    border: 4px solid #2D3142;
    border-radius: 20px;
    padding: 10px 20px;
    opacity: 0;
    transform-origin: center;
    pointer-events: none;
    z-index: 15;
}

.combo-display.show {
    opacity: 1;
    animation: comboShake 0.5s ease;
}

@keyframes comboShake {
    0%, 100% { transform: translateX(-50%) rotate(0deg) scale(1); }
    25% { transform: translateX(-50%) rotate(-5deg) scale(1.1); }
    75% { transform: translateX(-50%) rotate(5deg) scale(1.1); }
}

.combo-text {
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

.combo-count {
    font-size: 2em;
    font-weight: bold;
    color: #FFE66D;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.4);
}

.combo-multiplier {
    font-size: 1em;
    color: white;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

/* Instruction */
.instruction {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(45, 49, 66, 0.9);
    color: white;
    padding: 15px 25px;
    border-radius: 20px;
    font-size: 1.1em;
    text-align: center;
    max-width: 90%;
    animation: pulse 2s ease infinite;
    pointer-events: none;
    z-index: 5;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: white;
    border-top: 5px solid #2D3142;
}

.stat-box {
    text-align: center;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stat-number {
    font-size: 1.8em;
    font-weight: bold;
    color: #E63946;
    text-shadow: 2px 2px 0px #FFE66D;
}

/* ===== BOSS CALL SCREEN ===== */
.boss-call-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.boss-call-screen.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.boss-call-content {
    background: linear-gradient(135deg, #E63946 0%, #D62828 100%);
    border: 6px solid #2D3142;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 0 #2D3142;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    from { transform: scale(0.8) rotate(-5deg); }
    to { transform: scale(1) rotate(0); }
}

.phone-animation {
    text-align: center;
    font-size: 5em;
    margin-bottom: 20px;
    animation: phoneRing 0.5s ease infinite;
}

@keyframes phoneRing {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
}

.boss-name {
    font-size: 2em;
    color: white;
    text-shadow: 3px 3px 0px rgba(0,0,0,0.4);
    text-align: center;
    margin-bottom: 20px;
}

.boss-question {
    background: white;
    border: 4px solid #2D3142;
    border-radius: 15px;
    padding: 20px;
    font-size: 1.3em;
    color: #2D3142;
    text-align: center;
    margin-bottom: 25px;
    line-height: 1.6;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.answer-option {
    background: white;
    border: 4px solid #2D3142;
    border-radius: 12px;
    padding: 15px;
    font-size: 1.1em;
    color: #2D3142;
    cursor: pointer;
    transition: all 0.1s ease;
    text-align: left;
}

.answer-option:hover {
    transform: translateX(5px);
    background: #FFE66D;
}

.answer-option:active {
    transform: scale(0.95);
}

.penalty-warning {
    text-align: center;
    color: #FFE66D;
    font-size: 1.1em;
    font-weight: bold;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.4);
}

/* ===== PENALTY SCREEN ===== */
.penalty-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(230, 57, 70, 0.95);
    z-index: 150;
    align-items: center;
    justify-content: center;
}

.penalty-screen.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.penalty-content {
    text-align: center;
}

.penalty-title {
    font-size: 4em;
    color: white;
    text-shadow: 5px 5px 0px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    animation: shake 0.5s ease infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

.penalty-message {
    font-size: 2.5em;
    color: #FFE66D;
    text-shadow: 3px 3px 0px rgba(0,0,0,0.5);
}

/* ===== GAME OVER SCREEN ===== */
.game-over-screen,
.leaderboard-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.game-over-screen.show,
.leaderboard-screen.show {
    display: flex;
    animation: fadeIn 0.5s ease;
}

.game-over-content,
.leaderboard-content {
    background: white;
    border: 6px solid #2D3142;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 0 #2D3142;
    animation: popIn 0.6s ease;
}

.game-over-title {
    font-size: 2.5em;
    color: #FF6B35;
    text-shadow: 4px 4px 0px #FFE66D;
    text-align: center;
    margin-bottom: 25px;
}

.final-stats {
    background: #FFF9E6;
    border: 4px solid #2D3142;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
}

.final-stats h2 {
    font-size: 1.6em;
    color: #2D3142;
    text-shadow: 2px 2px 0px #FFE66D;
    text-align: center;
    margin-bottom: 15px;
}

.final-stat {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 2px dashed #E8E8E8;
    font-size: 1.1em;
}

.final-stat:last-child {
    border-bottom: none;
}

.final-value {
    font-weight: bold;
    color: #E63946;
    text-shadow: 2px 2px 0px #FFE66D;
}

.game-over-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== LEADERBOARD ===== */
.leaderboard-title {
    font-size: 2em;
    color: #2D3142;
    text-shadow: 3px 3px 0px #FFE66D;
    text-align: center;
    margin-bottom: 10px;
}

.leaderboard-subtitle {
    font-size: 1.1em;
    color: #666;
    text-align: center;
    margin-bottom: 20px;
}

.leaderboard-list {
    background: #FFF9E6;
    border: 4px solid #2D3142;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background: white;
    border: 3px solid #2D3142;
    border-radius: 10px;
}

.leaderboard-rank {
    font-size: 1.8em;
    font-weight: bold;
    width: 50px;
    text-align: center;
}

.leaderboard-rank.gold { color: #FFD700; }
.leaderboard-rank.silver { color: #C0C0C0; }
.leaderboard-rank.bronze { color: #CD7F32; }
.leaderboard-rank.normal { color: #2D3142; }

.leaderboard-info {
    flex: 1;
    margin: 0 10px;
}

.leaderboard-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #2D3142;
    margin-bottom: 3px;
}

.leaderboard-details {
    font-size: 0.85em;
    color: #666;
}

.leaderboard-score {
    font-size: 1.8em;
    font-weight: bold;
    color: #E63946;
    text-shadow: 2px 2px 0px #FFE66D;
}

.loading {
    text-align: center;
    font-size: 1.3em;
    color: #666;
    padding: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 1.8em;
    }
    
    .story-text {
        font-size: 1em;
    }
    
    .rules-list li {
        font-size: 0.9em;
    }
    
    .basket {
        width: 100px;
        height: 100px;
    }
    
    .basket-rim {
        font-size: 4em;
    }
    
    .ball {
        width: 50px;
        height: 50px;
        font-size: 2.5em;
    }
}
