/* Othello Local Styles */

/* Game Container (The Window) */
#game-container {
    width: 700px;
    height: 760px;
    background-color: #eeeeee;
    /* Swing default-ish gray */
    border: 1px solid #999;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    /* Center horizontally */
    color: #333;
    /* Reset text color for game app (it assumes light theme) */
}

/* Panels (Inside Game Container) */
.panel {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    /* Strict Match: Java code sets setBackground(new Color(204, 255, 229)); -> #ccffe5 */
    background: #ccffe5;
}

.panel.active {
    display: flex;
}

/* Header Group for Titles */
.panel-header-group {
    text-align: center;
    margin-bottom: 50px;
}

/* Strict Title: OTHELLO */
.game-title-pink {
    /* RESET Global h1 styles */
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    -webkit-text-fill-color: initial !important;


    /* Font("Arial", Font.ITALIC, 60) */
    font-family: "Arial", sans-serif;
    font-style: italic;
    font-size: 60px;
    /* new Color(255, 102, 178) -> #ff66b2 */
    color: #ff66b2 !important;
    margin: 0;
    font-weight: normal;
    /* Java Font doesn't imply Bold unless specified */
}

/* Strict Subtitle: Select your game mode */
.game-subtitle {
    /* RESET Global h2 styles */
    border-left: none !important;
    padding-left: 0 !important;

    /* Font("Arial", Font.ITALIC, 30) */
    font-family: "Arial", sans-serif;
    font-style: italic;
    font-size: 30px;
    color: #000;
    /* Default JLabel color usually black */
    margin: 10px 0 0 0;
    font-weight: normal;
}

/* Game Buttons */
.button-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    /* Spacing in grid layout was implicit, gap 30 feels right for "GridLayout(1,3)" spacing approximation */
}

.panel button {
    /* Strict Match: PanelHeader uses new Color(102, 178, 255) -> #66b2ff */
    background: #66b2ff;
    /* Strict Match: Font("メイリオ", Font.PLAIN, 30) */
    font-family: "Meiryo", "メイリオ", sans-serif;
    font-size: 30px;

    width: 300px;
    /* Fixed width to ensure uniformity like standard Swing component sizing */
    padding: 10px 0;
    cursor: pointer;
    color: #000;
    /* Default Swing text color */

    /* Swing Metal Look Emulation */
    border: 2px outset #eee;
    border-radius: 0;
    /* Swing buttons are rectangular */
    box-shadow: none;
    /* No modern soft shadow */
}

.panel button:hover {
    background: #55aaff;
    /* Slight darken on hover */
}

.panel button:active {
    border: 2px inset #eee;
    /* Pressed state */
}

.footer {
    margin-top: 50px;
}

/* Board UI */
#panel-game {
    justify-content: flex-start;
}

#header {
    width: 100%;
    height: 60px;
    background: #ccffe5;

    /* Spacing from top edge of container */
    margin-top: 40px;

    /* Robust Centering: Fixed center column width to safe-guard side text */
    display: grid;
    /* Center column fixed to 140px (Button 100px + padding). Sides take rest. */
    grid-template-columns: 1fr 140px 1fr;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
    border-bottom: none;
}

/* Header Texts (Left and Right) */
#header-names,
#header-turn {
    font-family: serif;
    font-size: 18px;
    color: #000;
    white-space: nowrap;
    /* Prevent wrapping causing layout break */
    overflow: hidden;
    text-overflow: ellipsis;
}

#header-names {
    text-align: left;
}

#header-turn {
    text-align: right;
}

/* Restart Button (Center) */
#header-restart {
    display: flex;
    justify-content: center;
    /* min-width removed, handled by grid column width */
}

.restart-btn {
    width: 100px;
    /* Remove fixed height to prevent overflow issues with fonts like Meiryo */
    min-height: 30px;

    background: #66b2ff;

    border: 2px outset #eee;
    border-radius: 0;

    font-family: "Meiryo", "メイリオ", sans-serif;
    font-size: 14px;
    /* Ensure line-height centers text and fits in button */
    line-height: 1.2;

    cursor: pointer;
    color: #000;
    padding: 2px 0;
    /* Adjust padding to approximate 30px height */
    margin: 0;
    /* Reset margins */
    display: flex;
    align-items: center;
    justify-content: center;
}

.restart-btn:active {
    border: 2px inset #eee;
}

#board-container {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Main Panel background (Light Green) covers this */
    background: #ccffe5;
}

#board {
    display: grid;
    /* Thick Black Lines: Container is Black, Gap reveals it */
    background: #000;
    gap: 3px;
    /* Thick lines */
    border: 3px solid #000;
    /* Outer border */
}

.cell {
    width: 70px;
    height: 70px;
    /* Deep Green Cells */
    background-color: #008000;
    /* Standard Othello Green or #006400 (DarkGreen) */
    /* Let's go with #008000 (Green) which is deeper than #ccffe5 but distinguishable from black lines. 
       Or #006400 if user wants "Deep". I'll use #006000 for a nice retro feel. */
    background-color: #006000;

    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    /* Gap handles the border */
}

/* Glossy Stones */
.stone {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    /* Shadow for depth */
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
}

.stone.black {
    /* Glossy Black: Dark grey to Black gradient */
    background: radial-gradient(circle at 35% 35%, #666, #000 60%);
}

.stone.white {
    /* Glossy White: White to Light Grey gradient */
    background: radial-gradient(circle at 35% 35%, #fff, #ddd 60%, #999 100%);
}

/* Responsive tweaking for Game Container if screen is small */
@media (max-width: 750px) {
    #game-container {
        width: 100%;
        height: auto;
        min-height: 100vw;
        overflow: hidden;
        /* Prevent overflow */
    }

    /* Cell size: Must ensure 8 cells fit within ~95vw to account for borders/gaps */
    /* 8 * 9vw = 72vw + gaps + borders = ~80vw, should fit */
    .cell {
        width: 9vw;
        height: 9vw;
    }

    /* Scale down panel buttons */
    .panel button {
        width: 60vw;
        max-width: 280px;
        font-size: 5vw;
        padding: 8px 0;
    }

    .button-container {
        gap: 15px;
    }

    /* Scale down titles */
    .game-title-pink {
        font-size: 12vw;
    }

    .game-subtitle {
        font-size: 5vw;
    }

    .panel-header-group {
        margin-bottom: 30px;
    }

    /* Header adjustments */
    #header {
        height: 40px;
        margin-top: 15px;
        padding: 0 5px;
        grid-template-columns: 1fr 85px 1fr;
        /* Wider for bigger restart button */
    }

    #header-names,
    #header-turn {
        font-size: 3vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Restart button - slightly wider */
    .restart-btn {
        width: 80px;
        font-size: 10px;
        min-height: 22px;
        padding: 2px 4px;
    }
}