/* Galactic Empire - Space Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a1a;
    color: #c8c8e0;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    height: 100vh;
}

h1, h2, h3 {
    color: #88aaff;
    text-shadow: 0 0 10px rgba(100, 150, 255, 0.5);
}

/* Landing Page */
#landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 30px;
}

#landing h1 {
    font-size: 3em;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: #aaccff;
    text-shadow: 0 0 20px rgba(100, 180, 255, 0.7), 0 0 40px rgba(100, 150, 255, 0.3);
}

h1 .subtitle {
    display: block;
    font-size: 0.5em;
    letter-spacing: 4px;
    color: #667799;
    margin-top: 5px;
}

.panel {
    background: rgba(20, 20, 50, 0.85);
    border: 1px solid #334;
    border-radius: 8px;
    padding: 20px;
    min-width: 350px;
}

.panel h2 {
    font-size: 1.1em;
    margin-bottom: 15px;
    border-bottom: 1px solid #334;
    padding-bottom: 8px;
}

label {
    display: block;
    font-size: 0.85em;
    color: #889;
    margin-bottom: 4px;
    margin-top: 10px;
}

input, select {
    width: 100%;
    padding: 8px 10px;
    background: #0d0d25;
    border: 1px solid #445;
    border-radius: 4px;
    color: #cce;
    font-family: inherit;
    font-size: 0.95em;
}

input:focus, select:focus {
    outline: none;
    border-color: #66aaff;
    box-shadow: 0 0 6px rgba(100, 170, 255, 0.3);
}

button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #2244aa, #3366cc);
    border: 1px solid #4477dd;
    border-radius: 4px;
    color: #ddeeff;
    font-family: inherit;
    font-size: 0.95em;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
}

button:hover {
    background: linear-gradient(135deg, #3355bb, #4477dd);
    box-shadow: 0 0 10px rgba(100, 150, 255, 0.4);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.danger {
    background: linear-gradient(135deg, #882222, #aa3333);
    border-color: #cc4444;
}

button.success {
    background: linear-gradient(135deg, #228822, #33aa33);
    border-color: #44cc44;
}

.game-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

.game-item {
    padding: 8px 12px;
    border: 1px solid #334;
    border-radius: 4px;
    margin-bottom: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.game-item:hover {
    background: rgba(50, 80, 150, 0.3);
}

.game-item .status {
    font-size: 0.8em;
    padding: 2px 8px;
    border-radius: 10px;
}

.status-lobby { background: #335; color: #8af; }
.status-active { background: #353; color: #8f8; }
.status-finished { background: #533; color: #f88; }

/* Game View */
#game-view {
    display: none;
    height: 100vh;
    grid-template-columns: 1fr 320px;
    grid-template-rows: 40px 1fr 180px;
    gap: 0;
}

#game-view.active {
    display: grid;
}

/* Top bar */
#top-bar {
    grid-column: 1 / -1;
    position: relative;
    background: rgba(15, 15, 40, 0.95);
    border-bottom: 1px solid #334;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 20px;
    font-size: 0.9em;
}

#top-bar .game-title {
    color: #88aaff;
    font-weight: bold;
    font-size: 1.1em;
}

#top-bar .turn-info {
    color: #aab;
}

#top-bar .player-info {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

.player-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Star Map */
#map-container {
    position: relative;
    overflow: hidden;
    background: #050510;
}

#star-map {
    width: 100%;
    height: 100%;
    display: block;
}

/* Info Panel */
#info-panel {
    background: rgba(15, 15, 40, 0.95);
    border-left: 1px solid #334;
    overflow-y: auto;
    padding: 10px;
    font-size: 0.82em;
}

#info-panel h3 {
    font-size: 0.95em;
    margin-bottom: 8px;
    color: #88aaff;
}

.info-section {
    margin-bottom: 15px;
}

.world-table {
    width: 100%;
    border-collapse: collapse;
}

.world-table th {
    text-align: left;
    color: #667;
    font-size: 0.85em;
    padding: 2px 4px;
    border-bottom: 1px solid #223;
}

.world-table td {
    padding: 2px 4px;
    border-bottom: 1px solid #1a1a30;
    font-size: 0.9em;
}

.world-table tr:hover {
    background: rgba(50, 80, 150, 0.2);
}

.world-table tr.selected {
    background: rgba(80, 120, 200, 0.3);
}

.fleet-item {
    padding: 4px 8px;
    border: 1px solid #223;
    border-radius: 3px;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.combat-item {
    padding: 6px 8px;
    border-left: 3px solid #ff6644;
    margin-bottom: 6px;
    background: rgba(50, 20, 10, 0.4);
    font-size: 0.85em;
}

.combat-item.victory {
    border-left-color: #44ff66;
    background: rgba(10, 50, 20, 0.4);
}

/* Order Panel */
#order-panel {
    grid-column: 1 / -1;
    background: rgba(15, 15, 40, 0.95);
    border-top: 1px solid #334;
    padding: 10px 15px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    overflow-y: auto;
}

.order-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.order-form label {
    margin: 0;
}

.order-form .field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-form input, .order-form select {
    width: 140px;
    padding: 6px 8px;
    font-size: 0.9em;
}

.order-form button {
    margin-top: 0;
    padding: 6px 14px;
}

#pending-orders {
    flex: 1;
    max-height: 150px;
    overflow-y: auto;
}

.pending-order {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(30, 50, 100, 0.5);
    border: 1px solid #445;
    border-radius: 4px;
    margin: 2px;
    font-size: 0.85em;
}

.pending-order .remove {
    cursor: pointer;
    color: #f66;
    font-weight: bold;
}

.pending-order .remove:hover {
    color: #ff4444;
}

#turn-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

/* Players sidebar section */
.player-entry {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 0.9em;
}

.player-entry .worlds-count {
    margin-left: auto;
    color: #889;
    font-size: 0.85em;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0a0a1a;
}
::-webkit-scrollbar-thumb {
    background: #334;
    border-radius: 3px;
}

/* Tooltip */
#tooltip {
    display: none;
    position: absolute;
    background: rgba(10, 10, 30, 0.95);
    border: 1px solid #556;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.85em;
    pointer-events: none;
    z-index: 100;
    max-width: 200px;
}

/* Join dialog */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

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

.modal {
    background: #141432;
    border: 1px solid #445;
    border-radius: 8px;
    padding: 25px;
    min-width: 300px;
}

.modal h2 {
    margin-bottom: 15px;
}

/* Color picker grid */
.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.color-swatch:hover, .color-swatch.selected {
    border-color: #fff;
}

/* Auth screens */
#login-screen, #gamer-tag-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.google-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #fff;
    color: #333;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1em;
    font-weight: 500;
    transition: box-shadow 0.2s;
    border: 1px solid #ddd;
}

.google-btn:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    background: #f8f8f8;
}

#user-bar a {
    text-decoration: none;
}
#user-bar a:hover {
    color: #aab;
}

/* Combat dropdown */
#combat-bar {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    background: rgba(17, 8, 8, 0.95);
    border-bottom: 1px solid #3a1a1a;
    font-size: 0.85em;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
#combat-bar-content .combat-entry {
    padding: 3px 0;
    border-bottom: 1px solid #1a1010;
    color: #aab;
}
#combat-bar-content .combat-entry .turn-label {
    color: #667;
    font-size: 0.85em;
    margin-right: 8px;
}
#combat-bar-content .combat-entry.victory {
    color: #8f8;
}
#combat-bar-content .combat-entry.defeat {
    color: #f88;
}
#combat-bar-content .combat-entry.other {
    color: #aab;
}
