body { 
    margin: 0; 
    font-family: system-ui, Arial, sans-serif; 
    display: flex; 
    height: 100vh; 
    overflow: hidden; 
    background: #f0f0f0; 
}

.left { 
    width: 460px; 
    min-width: 460px; 
    padding: 15px; 
    box-sizing: border-box; 
    background: #f5f6f7; 
    border-right: 1px solid #ccc; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}

.editor-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 5px; 
    flex-wrap: wrap; 
    gap: 5px; 
}

.editor-wrap { 
    width: 100%; 
    height: 20vh; 
    min-height: 120px; 
}

textarea {
    width: 100% !important; 
    height: 100%; 
    padding: 10px;
    font-family: 'Cascadia Code', 'Consolas', monospace; 
    font-size: 12px;
    line-height: 1.4; 
    border: 1px solid #999; 
    border-radius: 4px;
    box-sizing: border-box; 
    display: block; 
    resize: vertical; 
    background: #ffffff;
}

.game-panel { 
    background: #e3e8ee; 
    padding: 15px; 
    border-radius: 8px; 
    border: 1px solid #c0cddb; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.game-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 2px solid #bdc3c7; 
    padding-bottom: 8px; 
}

.game-header h3 { 
    margin: 0; 
    color: #2c3e50; 
    display: flex; 
    align-items: baseline; 
    gap: 8px; 
}

.version-tag { 
    font-size: 11px; 
    background: #34495e; 
    color: #fff; 
    padding: 2px 6px; 
    border-radius: 4px; 
    vertical-align: middle; 
    font-weight: bold; 
}

.settings-row { 
    background: #fff; 
    padding: 8px; 
    border-radius: 6px; 
    display: flex; 
    gap: 10px; 
    font-size: 12px; 
    font-weight: bold; 
    align-items: center; 
    border: 1px solid #bdc3c7; 
    flex-wrap: wrap; 
}

.settings-row label { 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    cursor: pointer; 
}

.settings-row select { 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    padding: 2px 4px; 
    font-size: 11.5px; 
    font-weight: bold; 
}

.settings-row input[type="number"] { 
    width: 45px; 
    text-align: center; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    padding: 3px; 
    font-family: monospace; 
}

.settings-row input[type="color"] { 
    border: none; 
    background: none; 
    width: 22px; 
    height: 22px; 
    cursor: pointer; 
    padding: 0; 
}

.settings-row input[type="checkbox"] { 
    width: 16px; 
    height: 16px; 
    cursor: pointer; 
}

.time-config { 
    font-size: 13px; 
    font-weight: bold; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
}

.time-config input { 
    width: 50px; 
    padding: 4px; 
    border: 1px solid #aaa; 
    border-radius: 4px; 
    text-align: center; 
}

.players { 
    display: flex; 
    justify-content: space-between; 
    gap: 10px; 
}

.player-card { 
    flex: 1; 
    padding: 10px; 
    background: #fff; 
    border-radius: 6px; 
    border: 2px solid transparent; 
    text-align: center; 
    transition: 0.2s; 
    position: relative; 
}

.player-card.active { 
    border-color: #2ecc71; 
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.4); 
    transform: scale(1.02); 
}

.player-type-select {
    width: 100%; 
    padding: 4px 6px; 
    font-weight: bold; 
    border-radius: 4px;
    border: 1px solid #bdc3c7; 
    margin-bottom: 6px; 
    font-size: 11.5px;
    background: #f8fafc; 
    color: #2c3e50; 
    outline: none; 
    cursor: pointer; 
}

.clock { 
    font-family: monospace; 
    font-size: 24px; 
    font-weight: bold; 
    margin: 5px 0; 
}

.color-pick { 
    width: 100%; 
    height: 30px; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    padding: 0; 
}

.player-moves { 
    font-size: 13px; 
    font-weight: bold; 
    margin-top: 5px; 
    height: 16px; 
}

.mdi-area { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    background: #2c3e50; 
    padding: 12px; 
    border-radius: 6px; 
    color: #fff; 
}

.mdi-label { 
    font-size: 11px; 
    font-weight: bold; 
    color: #bdc3c7; 
    text-transform: uppercase; 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 2px; 
}

.mdi-input-group { 
    display: flex; 
    gap: 6px; 
    align-items: center; 
}

.mdi-input-group input[type="text"] { 
    flex: 1; 
    min-width: 0; 
    padding: 8px 6px; 
    font-family: monospace; 
    font-size: 14px; 
    border: 2px solid #34495e; 
    border-radius: 4px; 
    background: #ecf0f1; 
    text-transform: uppercase; 
}

.mdi-input-group button { 
    background: #e74c3c; 
    color: white; 
    border: none; 
    padding: 0 12px; 
    height: 35px; 
    font-weight: bold; 
    font-size: 13px; 
    border-radius: 4px; 
    cursor: pointer; 
    transition: 0.2s; 
    white-space: nowrap; 
    flex-shrink: 0; 
}

.mdi-input-group button:hover { 
    background: #c0392b; 
}

.mdi-input-group button:disabled { 
    background: #7f8c8d; 
    cursor: not-allowed; 
}

.btn-undo-move { 
    background: #f39c12 !important; 
    padding: 0 9px !important; 
    font-size: 12px !important; 
}

.btn-undo-move:hover { 
    background: #d68910 !important; 
}

.modal-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 6px; 
    background: #1a252f; 
    padding: 8px; 
    border-radius: 4px; 
    font-family: monospace; 
    font-size: 12px; 
    text-align: center; 
    font-weight: bold; 
}

.modal-grid div { 
    background: #2c3e50; 
    padding: 6px; 
    border-radius: 3px; 
    border: 1px solid #34495e; 
    color: #ecf0f1; 
}

.log-area { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}

#move-log { 
    height: 80px; 
    overflow-y: auto; 
    background: #fff; 
    border: 1px solid #bdc3c7; 
    border-radius: 4px; 
    padding: 8px; 
    font-family: monospace; 
    font-size: 13px; 
    color: #2c3e50; 
    line-height: 1.5; 
}

#move-log-edit { 
    height: 80px; 
    display: none; 
    width: 100%; 
    box-sizing: border-box; 
    font-family: monospace; 
    font-size: 12px; 
    padding: 6px; 
    border: 1px solid #bdc3c7; 
    border-radius: 4px; 
    resize: vertical; 
}

.game-actions { 
    display: flex; 
    gap: 10px; 
    margin-top: 5px; 
}

.btn-primary { 
    flex: 1; 
    padding: 12px; 
    background: #2ecc71; 
    color: white; 
    border: none; 
    font-weight: bold; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 14px; 
}

.btn-primary:hover { 
    background: #27ae60; 
}

.btn-danger { 
    flex: 1; 
    padding: 12px; 
    background: #95a5a6; 
    color: white; 
    border: none; 
    font-weight: bold; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 14px; 
}

.btn-danger:hover { 
    background: #7f8c8d; 
}

.btn-secondary-sm { 
    background: #34495e; 
    color: white; 
    border: none; 
    padding: 5px 9px; 
    border-radius: 4px; 
    font-size: 11.5px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.15s; 
}

.btn-secondary-sm:hover { 
    background: #1a252f; 
}

.btn-file-sm { 
    background: #2980b9; 
    color: white; 
    border: none; 
    padding: 5px 9px; 
    border-radius: 4px; 
    font-size: 11.5px; 
    font-weight: bold; 
    cursor: pointer; 
    transition: 0.15s; 
}

.btn-file-sm:hover { 
    background: #1f618d; 
}

.modal-overlay { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    background: rgba(0,0,0,0.55); 
    z-index: 9999; 
    justify-content: center; 
    align-items: center; 
}

.modal-overlay.active { 
    display: flex; 
}

.modal-content { 
    background: #fff; 
    width: 440px; 
    max-width: 92%; 
    max-height: 80vh; 
    border-radius: 8px; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.3); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
}

.modal-top { 
    background: #2c3e50; 
    color: #fff; 
    padding: 12px 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.modal-top h4 { 
    margin: 0; 
    font-size: 15px; 
}

.modal-close-btn { 
    background: none; 
    border: none; 
    color: #ecf0f1; 
    font-size: 20px; 
    cursor: pointer; 
    font-weight: bold; 
}

.modal-body { 
    padding: 12px; 
    overflow-y: auto; 
}

.fields-table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 12.5px; 
}

.fields-table th { 
    background: #f5f6f7; 
    padding: 8px; 
    border-bottom: 2px solid #bdc3c7; 
    text-align: left; 
    color: #2c3e50; 
}

.fields-table td { 
    padding: 7px 8px; 
    border-bottom: 1px solid #e1e8ed; 
}

.fields-table tr:hover td { 
    background: #f8fafc; 
}

.btn-table-load { 
    background: #2ecc71; 
    color: white; 
    border: none; 
    padding: 4px 10px; 
    border-radius: 4px; 
    font-size: 12px; 
    font-weight: bold; 
    cursor: pointer; 
}

.btn-table-load:hover { 
    background: #27ae60; 
}

.rules-wrap { 
    background: #fff; 
    border: 1px solid #c0cddb; 
    border-radius: 8px; 
    padding: 15px; 
    font-size: 12.5px; 
    line-height: 1.5; 
    color: #2c3e50; 
}

.rules-wrap h3 { 
    margin: 0 0 10px 0; 
    color: #1a252f; 
    border-bottom: 2px solid #ecf0f1; 
    padding-bottom: 5px; 
}

.rules-wrap h4 { 
    margin: 10px 0 5px 0; 
    color: #2980b9; 
}

.rules-wrap ul { 
    margin: 0; 
    padding-left: 20px; 
}

.rules-wrap li { 
    margin-bottom: 4px; 
}

.right { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    padding: 10px; 
    box-sizing: border-box; 
    position: relative; 
}

#canvas-container { 
    flex: 1; 
    position: relative; 
    background: #fff; 
    border: 1px solid #bbb; 
    border-radius: 8px; 
    overflow: hidden; 
    cursor: default; 
}

canvas { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
}

.status-bar { 
    display: flex; 
    justify-content: space-between; 
    padding: 12px; 
    background: #333; 
    color: #fff; 
    border-radius: 0 0 8px 8px; 
    font-family: monospace; 
    font-size: 15px; 
}

#overlay-message { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    font-size: 34px; 
    font-weight: bold; 
    font-family: sans-serif; 
    text-align: center; 
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5); 
    display: none; 
    z-index: 10; 
    width: 100%; 
    line-height: 1.3; 
}