@font-face {
  font-family: 'Lautari';
  src: url('Lautari.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --main-bg:   #716e6b;
  --block-bg:  #faf9f7;
  --font-on-main: #f0edea;
  --font-on-block: #2e2c2b;
  --accent:    #d27f54;
  --border:    #1a1918;
  --tab-hover: #ffffff;
  --tab-inactive: #8a8784;
  --tab-active: #ffffff;
  --tab-highlight: #ff8c42;
  --white-piece: #f0edea;
  --black-piece: #2e2c2b;

  /* UI interaction colors */
  --error-red: #ff0000;
  --success-green: #00ff00;

  /* Board UI colors */
  --hover-highlight-bg: rgba(255, 255, 255, 0.3);
  --hover-highlight-border: rgba(255, 255, 255, 0.6);
  --selected-highlight-bg: rgba(255, 255, 0, 0.4);
  --selected-highlight-border: rgba(255, 255, 0, 0.8);
  --move-highlight-bg: rgba(50, 255, 50, 0.3);
  --move-highlight-border: rgba(50, 255, 50, 0.6);
  --capture-highlight-bg: rgba(255, 50, 50, 0.4);
  --capture-highlight-border: rgba(255, 50, 50, 0.8);

  /* Popup colors */
  --promotion-popup-bg: rgba(100, 100, 100, 0.9);
  --promotion-popup-border: rgba(255, 255, 255, 0.8);
  --revive-popup-bg: rgba(50, 200, 50, 0.9);
  --revive-popup-border: rgba(255, 255, 255, 0.8);

  /* Modal/Overlay colors */
  --modal-overlay-bg: rgba(0, 0, 0, 0.5);
  --modal-overlay-dark: rgba(0, 0, 0, 0.7);

  /* 3D view colors */
  --view-3d-bg: #4a4a4a;
  --camera-btn-bg: rgba(0, 0, 0, 0.6);
  --camera-btn-bg-hover: rgba(0, 0, 0, 0.8);
  --camera-btn-border: rgba(255, 255, 255, 0.3);
  --camera-btn-border-hover: rgba(255, 255, 255, 0.6);
  --camera-btn-text: white;
  --camera-btn-text-shadow: rgba(0, 0, 0, 0.8);

  /* Shadow colors */
  --shadow-dark: rgba(0, 0, 0, 0.3);
  --shadow-black: black;
  --piece-glow: rgba(255, 255, 255, 0.8);

  /* Misc colors */
  --room-row-border: #ddd;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: var(--main-bg);
    color: var(--font-on-main);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

app {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Tab bar */
tab-bar {
    display: flex;
    gap: 0px;
    border-bottom: 1px solid var(--border);
    background: var(--main-bg);
    overflow-x: auto;
}

tab {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--tab-inactive);
    color: var(--font-on-main);
    cursor: pointer;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    white-space: nowrap;
    min-width: 80px;
    max-width: 200px;
    flex-shrink: 1;
}

tab.active {
    background: var(--tab-active);
    color: var(--font-on-block);
}

tab.highlight {
    background: var(--tab-highlight);
}

tab-icon {
    margin-right: 6px;
    font-size: 16px;
    display: inline-block;
}

tab-icon.spectator::after {
    content: "👁";
}

tab-icon.player-white::after {
    content: "P";
    font-family: 'Lautari';
    color: var(--white-piece);
    font-size: 18px;
    -webkit-text-stroke: 0.5px var(--black-piece);
}

tab-icon.player-black::after {
    content: "P";
    font-family: 'Lautari';
    color: var(--black-piece);
    font-size: 18px;
    -webkit-text-stroke: 0.5px var(--black-piece);
}

/* Chat icons - same style as tab icons */
chat-icon {
    margin-right: 6px;
    font-size: 14px;
    display: inline-block;
}

chat-icon.spectator::after {
    content: "👁";
}

chat-icon.player-white::after {
    content: "P";
    font-family: 'Lautari';
    color: var(--white-piece);
    font-size: 16px;
    -webkit-text-stroke: 0.5px var(--black-piece);
}

chat-icon.player-black::after {
    content: "P";
    font-family: 'Lautari';
    color: var(--black-piece);
    font-size: 16px;
    -webkit-text-stroke: 0.5px var(--black-piece);
}

tab-name {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

tab-close {
    margin-left: 8px;
    font-weight: bold;
    padding: 0 4px;
    color: black;
}

tab-close:hover {
    color: var(--error-red);
}

/* Tab content */
tab-content-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

tab-content {
    display: none;
    padding: 10px 0;
    background: var(--main-bg);
    flex: 1;
    overflow: hidden;
}

tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Lobby layout */
lobby-content {
    display: flex;
    gap: 20px;
    flex: 1;
    overflow: hidden;
}

room-list { flex: 55; }
lobby-chat { flex: 35; }

chat-log {
    border: 1px solid var(--border);
    flex: 1;
    overflow-y: scroll;
    padding: 10px;
    background: var(--block-bg);
    color: var(--font-on-block);
}

input, button {
    margin: 5px;
    padding: 8px;
    background: var(--block-bg);
    color: var(--font-on-block);
    border: 1px solid var(--border);
}

button {
    cursor: pointer;
    background: var(--accent);
    color: var(--font-on-main);
}

button:hover {
    opacity: 0.8;
}

room-table {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border);
}

room-row {
    display: flex;
    background: var(--block-bg);
    color: var(--font-on-block);
    cursor: pointer;
}

room-row > * {
    padding: 8px;
    border: 1px solid var(--border);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Specific column widths */
room-row > *:nth-child(1) { flex: 0 0 80px; } /* Type (rating icon) */
room-row > *:nth-child(2) { flex: 1 1 150px; } /* White */
room-row > *:nth-child(3) { flex: 1 1 150px; } /* Black */
room-row > *:nth-child(4) { flex: 0 0 100px; } /* Spectators */
room-row > *:nth-child(5) { flex: 0 0 120px; } /* Status */

room-row.header {
    font-weight: bold;
    cursor: default;
}

/* Room view layout */
room-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 180px);
}

game-column {
    flex: 0 0 60%;
    background: var(--block-bg);
    color: var(--font-on-block);
    padding: 8px;
    border: 1px solid var(--border);
}

log-chat-column {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

room-actions {
    display: flex;
    gap: 10px;
}

players-info {
    display: block;
    background: var(--block-bg);
    color: var(--font-on-block);
    border: 1px solid var(--border);
    padding: 12px;
    margin: 10px 0;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

score-display {
    display: block;
    background: var(--block-bg);
    color: var(--font-on-block);
    border: 1px solid var(--border);
    padding: 10px;
    margin: 10px 0;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}

score-display:hover {
    background: var(--tab-active);
    color: var(--tab-highlight);
}

score-table {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 20px;
}

score-row {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
}

score-row > * {
    padding: 8px;
    text-align: center;
}

score-row > *:nth-child(1) {
    flex: 0 0 45px;
}

score-row > *:nth-child(2) {
    flex: 1;
}

score-row > *:nth-child(3) {
    flex: 1;
}

score-row.header-row {
    font-weight: bold;
    background: var(--block-bg);
    color: var(--font-on-block);
    border-bottom: 2px solid var(--border);
}

score-row.total-row {
    font-weight: bold;
    background: var(--tab-inactive);
    color: var(--font-on-main);
    border-top: 2px solid var(--border);
    margin-top: 10px;
}

game-log {
    background: var(--block-bg);
    color: var(--font-on-block);
    border: 1px solid var(--border);
    padding: 10px;
    overflow-y: auto;
    height: 30vh;
}

game-log h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.game-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-family: monospace;
}

.game-log-table th {
    background: var(--main-bg);
    color: var(--font-on-main);
    padding: 4px;
    text-align: left;
    border: 1px solid var(--border);
    position: sticky;
    top: 0;
}

.game-log-table td {
    padding: 2px 4px;
    border: 1px solid var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Flexbox game log table */
game-log-table-flex {
    display: flex;
    flex-direction: column;
    width: 100%;
    font-size: 12px;
    font-family: monospace;
}

game-log-row {
    display: flex;
    border-bottom: 1px solid var(--border);
}

game-log-row.game-log-header {
    background: var(--main-bg);
    color: var(--font-on-main);
    font-weight: bold;
    position: sticky;
    top: 0;
}

game-log-cell {
    padding: 4px;
    border-right: 1px solid var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

game-log-cell:last-child {
    border-right: none;
}

/* Column widths */
game-log-row game-log-cell:nth-child(1) {
    flex: 0 0 4ch;
}

game-log-row game-log-cell:nth-child(2) {
    flex: 0 0 10ch;
}

game-log-row game-log-cell:nth-child(3) {
    flex: 0 0 10ch;
}

game-log-body {
    display: flex;
    flex-direction: column;
}

room-chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: var(--block-bg);
    border: 1px solid var(--border);
}

room-chat {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    color: var(--font-on-block);
}

room-chat-input {
    display: flex;
    gap: 5px;
    padding: 10px;
    border-top: 1px solid var(--border);
}

room-chat-input input {
    flex: 1;
    margin: 0;
}

room-chat-input button {
    margin: 0;
}

move-input-container {
    display: flex;
    gap: 5px;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid var(--border);
    background: var(--block-bg);
}

move-input-container input {
    flex: 1;
    margin: 0;
}

move-input-container button {
    margin: 0;
}

game-info {
    display: block;
    padding: 8px 10px;
    margin-top: 5px;
    background: var(--block-bg);
    color: var(--font-on-block);
    border: 1px solid var(--border);
}

/* Login Form */
login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

login-form label {
    font-weight: bold;
    margin-bottom: -5px;
}

login-form input {
    padding: 8px;
    font-size: 14px;
    border: 1px solid var(--border);
    background: var(--block-bg);
    color: var(--font-on-block);
}

modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

chat-message {
    margin-bottom: 5px;
    display: flex;
    flex-wrap: wrap;
}

chat-user {
    font-weight: bold;
    margin-right: 5px;
}

/* App header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

header h2 {
    margin: 0;
}

/* Status indicator */
status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    cursor: help;
    margin-right: 10px;
}

status-indicator.status-connected {
    background: #00ff00;
}

status-indicator.status-connecting {
    background: #ffff00;
}

status-indicator.status-disconnected {
    background: #ff0000;
}

/* User info block */
/* Tutorial button */
.tutorial-btn {
    margin-left: auto;
    padding: 8px 16px;
    background: var(--accent);
    color: var(--font-on-main);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.tutorial-btn:hover {
    color: var(--accent);
    background: var(--tab-hover);
}

user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

user-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--block-bg);
    color: var(--font-on-block);
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: var(--font-on-main);
    border-radius: 50%;
    font-weight: bold;
    font-size: 18px;
}

user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

user-name {
    font-weight: bold;
    font-size: 14px;
}

user-rating {
    font-size: 12px;
    opacity: 0.8;
}

user-stats {
    display: flex;
    gap: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
}

user-stats stat-item {
    display: inline-block;
    font-size: 14px;
    cursor: help;
}

.edit-user-btn {
    margin-left: 8px;
    padding: 4px 8px;
    font-size: 14px;
    background: var(--accent);
    color: var(--font-on-main);
    border: 1px solid var(--border);
    cursor: pointer;
    border-radius: 3px;
}

.edit-user-btn:hover {
    opacity: 0.8;
}

/* Lobby specific */
lobby-content > *:first-child {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Room list and chat container */
lobby-content > *:nth-child(2) {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

room-list, lobby-chat {
    display: flex;
    flex-direction: column;
    min-width: 300px;
    height: 100%;
    overflow: hidden;
}

room-list h4, lobby-chat h4 {
    margin-top: 0;
    background: var(--block-bg);
    color: var(--font-on-block);
    padding: 10px;
    border: 1px solid var(--border);
}

lobby-chat > *:nth-child(3) {
    display: flex;
    gap: 5px;
}

lobby-chat input {
    flex: 1;
}

/* Tutorial styles */
tutorial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.tutorial-text-container {
    margin: 20px 0;
}

.tutorial-text-container p {
    margin: 10px 0;
    line-height: 1.6;
}

.tutorial-button-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.tutorial-button-container button {
    flex: 1;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background: var(--accent);
    color: var(--font-on-main);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: background 0.2s;
}

.tutorial-button-container button:hover {
    background: var(--tab-hover);
    color: var(--accent);
}

interactive-tutorial-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    width: 100%;
    background: var(--block-bg);
    padding: 8px;
    border: 1px solid var(--border);
}

.tutorial-board {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.tutorial-message {
    padding: 15px 20px;
    background: var(--block-bg);
    color: var(--font-on-block);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin: 10px;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
    transition: background 0.2s ease;
}

.tutorial-message.message-updated {
    animation: messageBlink 0.2s ease;
}

@keyframes messageBlink {
    0% {
        background: var(--block-bg);
    }
    50% {
        background: var(--accent);
        color: var(--font-on-main);
    }
    100% {
        background: var(--block-bg);
        color: var(--font-on-block);
    }
}

.tutorial-camera-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    flex-wrap: wrap;
}

.tutorial-camera-btn {
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    background: var(--accent);
    color: var(--font-on-main);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
}

.tutorial-camera-btn:hover {
    background: var(--tab-hover);
    transform: scale(1.05);
}

tutorial-nav-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: var(--main-bg);
    border-top: 1px solid var(--border);
}

.tutorial-nav-btn {
    padding: 10px 30px;
    font-size: 16px;
    cursor: pointer;
    background: var(--accent);
    color: var(--font-on-main);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: background 0.2s;
}

.tutorial-nav-btn:hover {
    color: var(--accent);
    background: var(--tab-hover);
}

.tutorial-nav-next {
    font-weight: bold;
}

/* Tutorial Table of Contents */
tutorial-toc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.tutorial-toc-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.tutorial-toc-content h2 {
    margin: 0 0 20px 0;
    text-align: center;
    color: var(--accent);
    font-size: 24px;
}

.tutorial-toc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tutorial-toc-item {
    color: var(--accent);
    cursor: pointer;
    font-size: 16px;
    text-decoration: underline;
    padding: 4px 0;
    transition: color 0.2s;
}

.tutorial-toc-item:hover {
    color: var(--tab-highlight);
}

.tutorial-toc-item-sub {
    margin-left: 30px;
    font-size: 14px;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
    room-container {
        flex-direction: column;
        height: auto;
    }

    game-column {
        flex: 1;
        min-height: 300px;
    }

    log-chat-column {
        flex: 1;
    }

    lobby-content > *:nth-child(2) {
        flex-direction: column;
    }

    room-list, lobby-chat {
        flex: 1;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    tab-content {
        padding: 10px;
    }

    room-container {
        gap: 10px;
    }
}

/* Game column should be flex container */
game-column {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Dual View System - Strategic and 3D Views */
views-container {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 500px;
    flex: 1;
}

.game-view {
    position: absolute;
    background: var(--block-bg);
    border: 2px solid var(--border);
    box-sizing: border-box;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.main-view {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.minimap-view {
    top: 10px;
    right: 10px;
    width: 15%;
    height: 15%;
    z-index: 10;
    cursor: pointer;
    border: 3px solid var(--accent);
    box-shadow: 0 4px 8px var(--shadow-dark);
    transform-origin: top right;
    overflow: hidden;
}

/* Scale 3D minimap smaller */
.view-3d.minimap-view {
    width: 10%;
}

.minimap-view > * {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.minimap-view game-board {
    margin: 0;
}

.minimap-view iframe {
    object-fit: contain;
}

.minimap-view:hover {
    border-color: var(--tab-highlight);
    transform: scale(1.05);
}

.strategic-view {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.strategic-view.main-view {
    max-height: 100%;
    height: 100%;
}

.strategic-view.main-view game-board {
    max-height: 100%;
}

game-board {
    display: block;
    position: relative;
    height: 100%;
    aspect-ratio: 920 / 1630;
    margin: 0 auto;
    background-image: url(images/board.svg), url(images/board-filled.svg);
    background-size: contain, contain;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    cursor: pointer;
}

game-board > highlightscontainer,
game-board > piecescontainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.view-3d {
    background: var(--view-3d-bg);
    display: flex;
    flex-direction: column;
}

board-3d {
    display: flex;
    width: 100%;
    height: 100%;
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 400px;
}

board-3d canvas {
    display: block;
    margin: 0 auto;
    background: transparent;
}

/* Scale 3D view in minimap */
.view-3d.minimap-view board-3d {
    min-height: 0;
}

.view-3d.minimap-view board-3d canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

/* Camera controls for 3D view */
camera-controls-3d {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
    z-index: 50;
}

view-3d.minimap-view camera-controls-3d {
    display: none !important;
}

.camera-btn {
    width: 40px;
    height: 40px;
    background: var(--camera-btn-bg);
    border: 2px solid var(--camera-btn-border);
    border-radius: 5px;
    color: var(--camera-btn-text);
    font-size: 20px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.camera-btn:hover:not(:disabled) {
    background: var(--camera-btn-bg-hover);
    border-color: var(--camera-btn-border-hover);
}

.camera-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.camera-btn-fullscreen::before {
    content: "⤡";
}

/* Notification indicator on fullscreen button */
.camera-btn-fullscreen.has-notification::after {
    content: "";
    position: absolute;
    top: -6px;
    right: -6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff8c42;
    pointer-events: none;
}

.camera-btn-zoom-out::before,
.camera-btn-zoom-in::before {
    position: absolute;
    font-size: 12px;
    font-weight: bold;
    color: var(--camera-btn-text);
    text-shadow: 0 0 2px var(--camera-btn-text-shadow);
    pointer-events: none;
    margin-left: -6px;
    margin-top: -6px;
}

.camera-btn-zoom-out::before {
    content: "+";
}

.camera-btn-zoom-in::before {
    content: "-";
}

.camera-btn.spectator-only {
    display: none;
}

view-3d.spectator-mode .camera-btn.spectator-only {
    display: flex;
}

/* Strategic view buttons - black text and border */
.camera-btn.strategic-btn {
    color: var(--black-piece);
    border-color: var(--black-piece);
}

.camera-btn.strategic-btn::before {
    color: var(--black-piece);
}

.camera-btn.strategic-btn:hover:not(:disabled) {
    border-color: var(--black-piece);
}

strategic-view.spectator-mode .camera-btn.spectator-only {
    display: flex;
}

/* Hide strategic buttons in minimap */
strategic-view.minimap-view camera-controls-3d {
    display: none;
}

/* Fullscreen game mode */
body.fullscreen-game {
    overflow: hidden;
}

body.fullscreen-game app-header,
body.fullscreen-game tab-bar,
body.fullscreen-game log-chat-column {
    display: none;
}

body.fullscreen-game game-column {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1000 !important;
}

/* Game End Modal */
game-end-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

modal-content {
    background: var(--block-bg);
    color: var(--font-on-block);
    padding: 30px;
    border-radius: 8px;
    border: 2px solid var(--border);
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 4px 6px var(--shadow-dark);
}

/* Generic Modal overlay and content for Modal.js class */
modal {
    display: block;
}

modal.hidden {
    display: none;
}

modal > overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

modal > overlay > content {
    background: var(--block-bg);
    padding: 30px;
    border-radius: 8px;
    color: var(--font-on-block);
}

modal-content h3 {
    margin: 0 0 20px 0;
    text-align: center;
    color: var(--accent);
}

modal-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

modal-content table td {
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border);
}

modal-content table tr:first-child td {
    font-weight: bold;
    background: var(--main-bg);
    color: var(--font-on-main);
}

modal-content button {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    color: var(--font-on-main);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

modal-content button:hover {
    background: var(--tab-highlight);
}

/* Piece styling */
.piece {
    position: absolute;
    font-family: Lautari, Arial;
    cursor: pointer;
    pointer-events: none;
    user-select: none;
    transition: all 0.2s ease;
    font-size: 36px;
    transform: translate(-50%, -50%);
}

.piece:hover {
    filter: drop-shadow(0 0 6px var(--piece-glow));
    z-index: 10;
}

.piece.white {
    color: var(--white-piece);
    -webkit-text-stroke: 1px var(--black-piece);
    text-shadow: 0 0 2px #000, 0 0 4px #000;
}

.piece.black {
    color: var(--black-piece);
    -webkit-text-stroke: 1px var(--white-piece);
    text-shadow: 0 0 2px #fff, 0 0 4px #fff;
}

/* Popup text colors - white and black pieces */
.popup-text-white {
    color: var(--white-piece);
    -webkit-text-stroke: 1px var(--black-piece);
    text-shadow: 0 0 2px #000, 0 0 4px #000;
}

.popup-text-black {
    color: var(--black-piece);
    -webkit-text-stroke: 1px var(--white-piece);
    text-shadow: 0 0 2px #fff, 0 0 4px #fff;
}

/* Freed cell markers */
.freed-cell-marker {
    position: absolute;
    color: var(--success-green);
    font-weight: bold;
    pointer-events: none;
    text-shadow: 0 0 3px var(--shadow-black);
}

/* Board highlights */
.hover-highlight {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--hover-highlight-bg);
    border: 2px solid var(--hover-highlight-border);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.selected-highlight {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--selected-highlight-bg);
    border: 3px solid var(--selected-highlight-border);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.cell-highlight {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.cell-highlight.capture {
    background-color: var(--capture-highlight-bg);
    border: 3px solid var(--capture-highlight-border);
}

.cell-highlight.move {
    background-color: var(--move-highlight-bg);
    border: 2px solid var(--move-highlight-border);
}

/* Promotion and revive popups */
.promotion-popup,
.revive-popup {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid var(--promotion-popup-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
    font-size: 32px;
    font-family: Lautari, Arial;
    user-select: none;
    z-index: 100;
    pointer-events: auto;
    transform: translate(20%, -150%);
}

.promotion-popup {
    background-color: var(--promotion-popup-bg);
}

.revive-popup {
    background-color: var(--revive-popup-bg);
}

/* 3D board popups (positioned with pixels instead of percentages) */
.promotion-popup-3d,
.revive-popup-3d {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid var(--promotion-popup-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
    font-size: 32px;
    font-family: Lautari, Arial;
    user-select: none;
    z-index: 100;
    pointer-events: auto;
}

.promotion-popup-3d {
    background-color: var(--promotion-popup-bg);
}

.revive-popup-3d {
    background-color: var(--revive-popup-bg);
}

/* Lobby styles */
.columns {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex: 1;
    overflow: hidden;
}
