/* ============================================
   PC FÚTBOL WEB - RETRO STYLE
   Inspired by the classic PC Fútbol UI (1992)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
    --bg-dark: #0a0a2e;
    --bg-medium: #1a1a4e;
    --bg-panel: #12123a;
    --border-color: #4444aa;
    --border-light: #6666cc;
    --text-primary: #ffffff;
    --text-secondary: #aaaadd;
    --text-accent: #ffcc00;
    --btn-primary: #2244aa;
    --btn-primary-hover: #3355cc;
    --btn-danger: #aa2222;
    --green-pitch: #1a6b1a;
    --green-light: #228b22;
    --highlight: #ffcc00;
    --positive: #44cc44;
    --negative: #cc4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'VT323', monospace;
    font-size: 18px;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

/* Screens */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ===== TITLE SCREEN ===== */
.title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    background: linear-gradient(180deg, #0a0a3e 0%, #1a1a6e 50%, #0a0a3e 100%);
    margin: -20px;
    padding: 40px 20px;
}

.game-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 48px;
    color: var(--highlight);
    text-shadow: 4px 4px 0 #aa8800, 6px 6px 0 #664400;
    letter-spacing: 4px;
    animation: titlePulse 2s ease-in-out infinite;
}

.game-subtitle {
    font-family: 'Press Start 2P', cursive;
    font-size: 20px;
    color: var(--text-secondary);
    margin-top: 10px;
    letter-spacing: 8px;
}

.title-divider {
    width: 300px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--highlight), transparent);
    margin: 20px auto;
}

.game-season {
    font-family: 'VT323', monospace;
    font-size: 28px;
    color: var(--text-accent);
}

.title-menu {
    margin-top: 50px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.title-footer {
    margin-top: 60px;
    color: var(--text-secondary);
    font-size: 14px;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* ===== BUTTONS ===== */
.btn-retro {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    padding: 15px 30px;
    background: linear-gradient(180deg, #3355bb 0%, #2244aa 50%, #1a3388 100%);
    color: var(--text-primary);
    border: 2px solid var(--border-light);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.15s;
    min-width: 250px;
    text-align: center;
}

.btn-retro:hover {
    background: linear-gradient(180deg, #4466cc 0%, #3355bb 50%, #2244aa 100%);
    border-color: var(--highlight);
    color: var(--highlight);
    transform: scale(1.02);
}

.btn-retro:active {
    transform: scale(0.98);
}

.btn-retro.btn-primary {
    background: linear-gradient(180deg, #44aa44 0%, #339933 50%, #228822 100%);
    border-color: #66cc66;
}

.btn-retro.btn-primary:hover {
    background: linear-gradient(180deg, #55bb55 0%, #44aa44 50%, #339933 100%);
}

.btn-retro.btn-small {
    font-size: 10px;
    padding: 8px 16px;
    min-width: auto;
}

.btn-retro.btn-danger {
    background: linear-gradient(180deg, #cc3333 0%, #aa2222 50%, #881a1a 100%);
    border-color: #ee5555;
}

/* ===== SCREEN HEADERS ===== */
.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 20px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.screen-header h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    color: var(--highlight);
}

.screen-footer {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

/* ===== TEAM SELECTION ===== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px 0;
    flex: 1;
}

.team-card {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.team-card:hover {
    border-color: var(--highlight);
    background: var(--bg-medium);
    transform: scale(1.03);
}

.team-card .team-crest {
    font-size: 40px;
    margin-bottom: 10px;
}

.team-card .team-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: var(--text-primary);
    line-height: 1.6;
}

.team-card .team-rating {
    margin-top: 8px;
    color: var(--text-accent);
    font-size: 16px;
}

/* ===== OFFICE SCREEN ===== */
.office-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.team-name-display {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    color: var(--highlight);
}

.week-display {
    margin-left: 20px;
    color: var(--text-secondary);
}

.budget-display {
    color: var(--positive);
    font-size: 22px;
    font-weight: bold;
}

.office-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    flex: 1;
    align-content: start;
    padding: 10px 0;
}

.office-btn {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    padding: 25px 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: var(--text-primary);
    font-family: 'VT323', monospace;
}

.office-btn:hover {
    border-color: var(--highlight);
    background: var(--bg-medium);
    transform: scale(1.03);
}

.office-btn-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.office-btn-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    letter-spacing: 1px;
}

.office-btn.btn-advance {
    border-color: var(--positive);
}

.office-btn.btn-advance:hover {
    background: #1a3a1a;
}

.office-news-ticker {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    padding: 10px 15px;
    margin-top: 15px;
    overflow: hidden;
    white-space: nowrap;
    color: var(--text-accent);
    font-size: 16px;
}

.office-news-ticker span {
    display: inline-block;
    animation: ticker 15s linear infinite;
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ===== RETRO TABLE ===== */
.retro-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.retro-table th {
    background: var(--bg-medium);
    color: var(--highlight);
    padding: 10px 8px;
    text-align: left;
    font-family: 'Press Start 2P', cursive;
    font-size: 9px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.retro-table td {
    padding: 8px;
    border-bottom: 1px solid #222255;
    white-space: nowrap;
}

.retro-table tr:hover {
    background: var(--bg-medium);
}

.retro-table tr.player-row {
    cursor: pointer;
}

.retro-table .highlight-row {
    background: #1a2a5e;
}

.retro-table .stat-high {
    color: var(--positive);
    font-weight: bold;
}

.retro-table .stat-mid {
    color: var(--text-accent);
}

.retro-table .stat-low {
    color: var(--negative);
}

/* ===== TACTICS ===== */
.tactics-container {
    display: flex;
    gap: 20px;
    flex: 1;
}

.tactics-left {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tactics-right {
    flex: 1;
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    padding: 15px;
    overflow-y: auto;
    max-height: 600px;
}

.tactics-right h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    color: var(--highlight);
    margin-bottom: 15px;
}

.formation-selector,
.tactics-style {
    display: flex;
    align-items: center;
    gap: 10px;
}

.formation-selector label,
.tactics-style label {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: var(--text-secondary);
}

.formation-selector select,
.tactics-style select,
.transfer-filters select {
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 8px 12px;
    background: var(--bg-panel);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    cursor: pointer;
}

/* Pitch */
.pitch {
    background: linear-gradient(180deg, #1a6b1a 0%, #228b22 50%, #1a6b1a 100%);
    border: 3px solid #ffffff;
    position: relative;
    width: 100%;
    height: 450px;
    border-radius: 4px;
}

.pitch::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.4);
}

.pitch::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50%;
}

.pitch-player {
    position: absolute;
    width: 60px;
    text-align: center;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: all 0.3s;
}

.pitch-player:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

.pitch-player .player-dot {
    width: 30px;
    height: 30px;
    background: var(--highlight);
    border: 2px solid #fff;
    border-radius: 50%;
    margin: 0 auto 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #000;
}

.pitch-player .player-name {
    font-size: 11px;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

.pitch-player .player-rating {
    font-size: 10px;
    color: var(--highlight);
}

/* Bench list */
.bench-list .bench-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #222255;
    cursor: pointer;
    font-size: 15px;
}

.bench-player:hover {
    background: var(--bg-medium);
}

.bench-player .bp-pos {
    color: var(--text-accent);
    width: 35px;
    font-size: 13px;
}

.bench-player .bp-name {
    flex: 1;
}

.bench-player .bp-rating {
    color: var(--text-secondary);
}

/* ===== TRANSFERS ===== */
.transfers-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.transfer-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.tab-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    padding: 10px 20px;
    background: var(--bg-panel);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn.active {
    background: var(--btn-primary);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.transfer-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.transfer-list {
    flex: 1;
    overflow-y: auto;
    max-height: 500px;
}

.transfer-player {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    margin-bottom: 5px;
    gap: 15px;
}

.transfer-player:hover {
    border-color: var(--highlight);
}

.transfer-player .tp-pos {
    color: var(--text-accent);
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    width: 40px;
}

.transfer-player .tp-name {
    flex: 1;
    font-size: 18px;
}

.transfer-player .tp-team {
    color: var(--text-secondary);
    font-size: 14px;
    width: 120px;
}

.transfer-player .tp-rating {
    width: 40px;
    text-align: center;
}

.transfer-player .tp-price {
    color: var(--positive);
    width: 100px;
    text-align: right;
}

.transfer-player .tp-action {
    width: 80px;
}

/* ===== TRAINING ===== */
.training-container {
    flex: 1;
}

.training-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.training-option {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.training-option:hover,
.training-option.active {
    border-color: var(--highlight);
    background: var(--bg-medium);
}

.training-option h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    color: var(--highlight);
    margin-bottom: 10px;
}

.training-current {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    padding: 20px;
    text-align: center;
}

.training-current input[type="range"] {
    width: 300px;
    margin: 10px 0;
}

/* ===== FINANCES ===== */
.finances-container {
    flex: 1;
}

.finance-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.finance-card {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    padding: 20px;
    text-align: center;
}

.finance-card h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 9px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.finance-value {
    font-size: 26px;
    color: var(--positive);
}

.finance-log {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    padding: 15px;
    max-height: 250px;
    overflow-y: auto;
}

.finance-log .log-entry {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #222255;
    font-size: 15px;
}

.log-entry .log-positive { color: var(--positive); }
.log-entry .log-negative { color: var(--negative); }

.stadium-upgrade {
    margin-top: 20px;
    text-align: center;
}

/* ===== NEWS ===== */
.news-container {
    flex: 1;
}

.news-item {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    padding: 15px;
    margin-bottom: 10px;
}

.news-item .news-date {
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    color: var(--text-accent);
    margin-bottom: 5px;
}

.news-item .news-title {
    font-size: 20px;
    color: var(--highlight);
    margin-bottom: 5px;
}

.news-item .news-body {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.4;
}

/* ===== CALENDAR ===== */
.calendar-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

#calendar-week-label {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    color: var(--highlight);
    min-width: 200px;
    text-align: center;
}

.calendar-matches {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-match {
    display: flex;
    align-items: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 12px 15px;
}

.calendar-match.is-player {
    border-color: var(--highlight);
    background: #1a1a5e;
}

.calendar-match .cm-home {
    flex: 1;
    text-align: right;
    padding-right: 15px;
}

.calendar-match .cm-score {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    color: var(--highlight);
    min-width: 70px;
    text-align: center;
}

.calendar-match .cm-away {
    flex: 1;
    padding-left: 15px;
}

/* ===== STANDINGS ===== */
.standings-container {
    flex: 1;
    overflow-x: auto;
}

/* ===== CREDITS ===== */
.credits-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.credits-container h2 {
    font-family: 'Press Start 2P', cursive;
    color: var(--highlight);
    margin-bottom: 30px;
}

.credits-text {
    margin-bottom: 40px;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ===== DIALOG / MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-box {
    background: var(--bg-dark);
    border: 3px solid var(--border-light);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-box h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    color: var(--highlight);
    margin-bottom: 20px;
}

.modal-box p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* ===== AUTH / USER MANAGEMENT ===== */
.auth-container {
    width: 100%;
    max-width: 400px;
    margin-top: 30px;
}

.auth-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    justify-content: center;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 15px;
}

.auth-form.active {
    display: flex;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: left;
}

.form-group label {
    font-family: 'Press Start 2P', cursive;
    font-size: 9px;
    color: var(--text-secondary);
}

.form-group input {
    font-family: 'VT323', monospace;
    font-size: 20px;
    padding: 10px 12px;
    background: var(--bg-panel);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--highlight);
}

.auth-error {
    color: var(--negative);
    font-size: 14px;
    min-height: 20px;
    text-align: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 15px 0;
    gap: 10px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    color: var(--text-secondary);
    font-size: 14px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    font-size: 16px;
}

/* Account screen */
.account-container {
    flex: 1;
}

.account-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.account-section {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    padding: 20px;
    margin-bottom: 15px;
}

.account-section .form-group {
    margin-bottom: 10px;
}

.account-section input {
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 8px 12px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    width: 100%;
    outline: none;
}

.account-section input:focus {
    border-color: var(--highlight);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .game-title { font-size: 28px; }
    .game-subtitle { font-size: 14px; }
    .office-grid { grid-template-columns: repeat(2, 1fr); }
    .tactics-container { flex-direction: column; }
    .finance-summary { grid-template-columns: 1fr; }
    .team-grid { grid-template-columns: repeat(2, 1fr); }
    .office-header { flex-direction: column; gap: 10px; }
}
