/* Base Game CSS - Desktop First */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    overflow: hidden;
    touch-action: manipulation;
}

/* Game Container */
#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Game Header */
#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: linear-gradient(to bottom, #1a1a1a, #0a0a0a);
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.level-display, .score-display, .accuracy-display, .fouls-display, .difficulty-display {
    font-size: 1.2rem;
    font-weight: bold;
}

.difficulty-display {
    background-color: #f39c12;
    color: #1a1a1a;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    text-transform: uppercase;
    font-size: 1rem;
}

.level-display span, .score-display span, .accuracy-display span {
    color: #f39c12;
}

.fouls-display span {
    color: #e74c3c;
}

/* Game Board */
#game-board {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Court Container - Desktop */
#court-container {
    position: relative;
    width: 800px;
    height: 600px;
    margin: 2rem auto;
}

#basketball-court {
    width: 100%;
    height: 100%;
    border: 2px solid #222;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Player Positions Container */
#player-positions {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Player Markers - Desktop */
.player-marker {
    position: absolute;
    width: 210px;
    height: 210px;
    cursor: default;
    z-index: 15;
    /* Players use percentage positioning with transform */
}

/* Number Display - Desktop */
.number-container {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

#current-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 255, 255, 0.7);
    animation: pulse 0.5s ease-in-out;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 16px;
    border-radius: 8px;
    line-height: 1;
    display: inline-block;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Input Phase */
#input-phase {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 100;
}

.court-recall-section {
    text-align: center;
    margin-bottom: 2rem;
}

/* Recall Court - Desktop */
#recall-court {
    position: relative;
    width: 800px;
    height: 600px;
    margin: 0 auto;
}

#recall-canvas {
    width: 100%;
    height: 100%;
    border: 2px solid #222;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Draggable Players Container */
#draggable-players {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Draggable Players - Desktop */
.draggable-player {
    position: absolute;
    width: 210px;
    height: 210px;
    cursor: move;
    transition: transform 0.1s ease;
    z-index: 10;
    pointer-events: all;
}

.draggable-player:hover {
    transform: scale(1.1);
}

.draggable-player.dragging {
    opacity: 0.7;
    z-index: 20;
}

.draggable-player.selected {
    outline: 3px solid #f39c12;
    outline-offset: 3px;
    transform: scale(1.1);
}

/* Spot Indicators - Desktop */
.spot-indicator {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid #FFD700;
    background: rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    cursor: pointer;
    z-index: 25;
    pointer-events: all;
    animation: spotPulse 1.5s ease-in-out infinite;
    /* Spot indicators use percentage positioning with transform */
}

.spot-indicator:hover {
    background: rgba(255, 215, 0, 0.5);
    transform: translate(-50%, -50%) scale(1.2);
}

.spot-indicator.original-spot {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.3);
}

.spot-indicator.original-spot:hover {
    background: rgba(46, 204, 113, 0.5);
}

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

/* Number Input Container */
.number-input-container {
    position: absolute;
    top: 26%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 15;
}

.number-input-container h3 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    font-weight: bold;
}

#number-input {
    font-size: 3rem;
    padding: 10px 20px;
    width: 120px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: 2px solid #f39c12;
    border-radius: 8px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 255, 255, 0.5);
    font-weight: bold;
    outline: none;
}

#number-input:focus {
    border-color: #e67e22;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.5);
}

/* Remove spinner buttons */
#number-input::-webkit-inner-spin-button,
#number-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#number-input[type=number] {
    -moz-appearance: textfield;
}

/* Position Instruction */
.position-instruction {
    font-size: 1.3rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

/* Submit Button */
.submit-btn {
    font-size: 1.5rem;
    padding: 1rem 3rem;
    background-color: #f39c12;
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
}

/* Menu */
.menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.menu h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #f39c12;
}

.menu p {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    color: #aaa;
}

.menu-btn {
    font-size: 1.5rem;
    padding: 1rem 3rem;
    margin: 0.5rem;
    background-color: #2a2a2a;
    color: #ffffff;
    border: 2px solid #f39c12;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background-color: #f39c12;
    color: #1a1a1a;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.modal-content {
    background-color: #2a2a2a;
    padding: 3rem;
    border-radius: 16px;
    max-width: 600px;
    text-align: center;
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #f39c12;
}

.close-modal {
    font-size: 1.2rem;
    padding: 0.8rem 2rem;
    background-color: #f39c12;
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 1rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}