/* =========================
   Global / Reset
========================= */
html,
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* =========================
   Layout
========================= */
#layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto 1fr auto;
    height: 100vh;
}

#header {
    grid-column: 1 / 4;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    gap: 45px;
    padding-top: 1rem;
}

#footer {
    grid-column: 1 / 4;
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
}

#container {
    grid-column: 2;
    grid-row: 2;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 90vmin;
    height: 90vmin;
    max-width: 500px;
    max-height: 500px;
}

#left-sidebar,
#right-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px;
}

/* =========================
   Start Screen
========================= */
#start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    height: 100vh;
}

.start-screen-txt {
    color: white;
    font-size: clamp(1rem, 2vw, 1.5rem);
    text-align: center;
}

#start-screen input {
    width: clamp(140px, 30vw, 220px);
    padding: 10px 14px;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    border: 2px solid #ccc;
    border-radius: 8px;
    outline: none;
}

/* =========================
   Text / Typography
========================= */
.title {
    color: white;
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: bold;
    font-style: italic;
}

.subtext {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: bold;
    font-style: italic;
}

.symbol,
.start-symbol {
    padding-top: 10px;
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-family: 'Press Start 2P', monospace;
}

.start-symbol {
    color: white;
}

/* Sidebar symbols */
#right-sidebar .symbol,
#left-sidebar .symbol {
    font-size: clamp(2rem, 6vw, 4rem);
}

/* =========================
   Counters / Display
========================= */
#rounds-counter,
#turns-counter,
#current-player-display {
    display: inline-block;
    min-width: 4rem;
    padding: 0.75rem 1.5rem;
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: bold;
    text-align: center;
    border-radius: 0.75rem;
    background: #f5f5f5;
    color: #333;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.1);
}

#counter-display {
    display: flex;
    gap: 50px;
    text-align: center;
}

/* =========================
   Sidebar Styling
========================= */
.sidebar-styling {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0.75rem 1.5rem;
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: bold;
    border-radius: 0.75rem;
    background: white;
    color: #333;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.1);
}

/* =========================
   Tiles
========================= */
.tile {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid black;
    border-radius: 1rem;
    font-size: 8vmin;
    font-family: 'Press Start 2P', monospace;
    line-height: 1;
    user-select: none;
}

.tile:hover {
    background: #7dcfff;
    border: 4px solid black;
    transform: scale(1.05);
}

/* =========================
   Buttons
========================= */
.ui-btn,
#popup-btn {
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
}

.ui-btn {
    border: none;
    background: #e74c3c;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.ui-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.ui-btn:active {
    transform: translateY(1px);
}

#next-round-btn {
    background: #e74c3c;
}

#popup-btn {
    width: fit-content;
    position: relative;
    padding: 0.5rem 0.8rem;
    background: #e7e7e7;
    border: 1px solid #333;
    border-radius: 8px;
}

#popup-btn:hover {
    background: #fff;
    border: 1px solid black;
    transform: scale(1.05);
}

/* =========================
   Popup
========================= */
#popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 1.5rem;
    min-width: 250px;
    background: white;
    border: 3px solid black;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-style: italic;
    text-align: center;
    z-index: 1000;
}

/* =========================
   Forms
========================= */
form {
    display: flex;
    flex-direction: column;
    gap: 30px;
    justify-content: center;
}

.player-input-container {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* =========================
   Utilities
========================= */
.hidden {
    display: none !important;
}
