/* === Shared Screen Layout === */
.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: radial-gradient(ellipse at center, #1e7a3a 0%, #145a28 60%, #0d3d1a 100%);
    color: #e0e0e0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* === Splash Screen === */
.splash-screen {
    gap: 24px;
}

.splash-content {
    text-align: center;
}

.splash-title {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 800;
    color: #ffd700;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.splash-subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: #ccc;
    margin-bottom: 32px;
}

.btn-start {
    background: #e74c3c;
    color: white;
    font-size: 1.1rem;
    padding: 14px 48px;
    min-height: 48px;
}

/* === Main Menu Screen === */
.menu-screen {
    gap: 32px;
}

.menu-title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 800;
    color: #ffd700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: clamp(200px, 40vw, 320px);
}

.btn-menu-item {
    background: #2e7d32;
    color: white;
    font-size: 1.1rem;
    padding: 14px 32px;
    min-height: 48px;
    width: 100%;
}

.btn-menu-item:not(:disabled):hover {
    background: #388e3c;
}

.menu-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: clamp(240px, 60vw, 480px);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.menu-banner-warning {
    background: rgba(230, 162, 30, 0.15);
    border: 1px solid rgba(230, 162, 30, 0.6);
    color: #ffd36b;
}

.menu-banner-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.menu-banner-close:hover {
    opacity: 0.75;
}

/* === Game Setup Screen === */
.setup-screen {
    gap: 24px;
}

.setup-title {
    font-size: 1.6rem;
    color: #ffd700;
}

.setup-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: clamp(200px, 40vw, 320px);
}

.setup-label {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 4px;
}

.btn-start-game {
    background: #e74c3c;
    color: white;
    font-size: 1.1rem;
    padding: 14px 48px;
    min-height: 48px;
    margin-top: 8px;
}

/* === Rules Screen === */
.rules-screen {
    justify-content: flex-start;
    padding-top: max(24px, env(safe-area-inset-top));
    overflow-y: auto;
}

.rules-content {
    max-width: 640px;
    width: 90%;
    padding: 16px 0 32px;
}

.rules-content h2 {
    color: #ffd700;
    font-size: 1.3rem;
    margin: 20px 0 8px;
}

.rules-content h3 {
    color: #aaa;
    font-size: 1rem;
    margin: 12px 0 4px;
}

.rules-content p,
.rules-content li {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.5;
}

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

.rules-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 0.85rem;
}

.rules-content th,
.rules-content td {
    padding: 6px 8px;
    border: 1px solid #3a5a4a;
    text-align: left;
}

.rules-content th {
    background: rgba(0, 0, 0, 0.3);
    color: #ffd700;
}

/* === Settings Screen === */
.settings-screen {
    gap: 24px;
}

.settings-title {
    font-size: 1.6rem;
    color: #ffd700;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: clamp(240px, 45vw, 360px);
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-group label {
    font-size: 0.9rem;
    color: #ccc;
}

.setting-group input[type="range"] {
    width: 100%;
    accent-color: #4caf50;
}

.setting-group select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #3a5a4a;
    background: #1e3a2a;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.setting-value {
    font-size: 0.8rem;
    color: #888;
    text-align: right;
}

.setting-toggle {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.toggle-btn {
    padding: 6px 20px;
    border-radius: 14px;
    border: 1px solid #3a5a4a;
    background: #1e3a2a;
    color: #888;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 60px;
    transition: background 0.15s, color 0.15s;
}

.toggle-btn.toggle-on {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

/* === About Screen === */
.about-screen {
    justify-content: flex-start;
    padding-top: max(24px, env(safe-area-inset-top));
    overflow-y: auto;
}

.about-content {
    max-width: 640px;
    width: 90%;
    padding: 16px 0 32px;
}

.about-title {
    color: #ffd700;
    font-size: 1.8rem;
    margin: 8px 0 4px;
}

.about-tagline {
    color: #ccc;
    font-size: 0.95rem;
    margin: 0 0 20px;
}

.about-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 16px;
    margin: 0 0 20px;
    font-size: 0.9rem;
}

.about-meta dt {
    color: #888;
}

.about-meta dd {
    color: #e0e0e0;
    margin: 0;
}

.about-content section h3 {
    color: #ffd700;
    font-size: 1.1rem;
    margin: 16px 0 6px;
}

.about-content section p,
.about-content section li {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.5;
}

.about-links {
    padding-left: 20px;
    margin: 4px 0;
}

.about-links a {
    color: #6bc96b;
    text-decoration: none;
}

.about-links a:hover {
    text-decoration: underline;
}

/* === Account Screen === */
.account-screen {
    justify-content: flex-start;
    padding-top: max(24px, env(safe-area-inset-top));
    overflow-y: auto;
}

.account-content {
    max-width: 640px;
    width: 90%;
    padding: 16px 0 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.account-loading {
    color: #ccc;
    margin-top: 32px;
}

.account-avatar-hero {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
}

.account-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-section-title {
    color: #ffd700;
    font-size: 1rem;
    margin: 0;
}

.avatar-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.avatar-tile {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 999px;
    padding: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.avatar-tile:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.avatar-tile:disabled {
    opacity: 0.6;
    cursor: progress;
}

.avatar-tile-selected {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.12);
}

.account-field-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.account-input {
    flex: 1 1 200px;
    min-width: 160px;
    padding: 10px 12px;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
}

.account-save,
.account-copy {
    width: auto;
    min-width: 120px;
}

.account-player-id {
    flex: 1 1 200px;
    min-width: 0;
    padding: 10px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    color: #e0e0e0;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    overflow-wrap: anywhere;
}

.account-error {
    color: #ff8a80;
    font-size: 0.85rem;
    margin: 0;
}

.account-link-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-link-row .btn-menu-item {
    width: auto;
    min-width: 160px;
}

.account-coming-soon {
    color: #888;
    font-size: 0.8rem;
    font-style: italic;
}

/* === Back Button === */
.btn-back {
    background: #607d8b;
    color: white;
    font-size: 0.9rem;
    padding: 10px 28px;
    min-height: 48px;
    margin-top: 16px;
}

.screen-header {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 90%;
    max-width: 640px;
}

.screen-header-title {
    color: #ffd700;
    margin: 0;
    font-size: 1.3rem;
}

/* === Avatar === */
.avatar {
    display: inline-block;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-drag: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.avatar-sm { width: 24px; height: 24px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 64px; height: 64px; }

/* === Avatars temporarily hidden — artwork is being reworked.
   Remove this block to restore avatars across the app. === */
.avatar,
.account-avatar-hero,
.account-section:has(> .avatar-picker) {
    display: none;
}

/* === Profile Chip === */
.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1;
    max-width: 320px;
}

.profile-chip-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.profile-chip-nickname {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-chip-coins {
    font-size: 0.75rem;
    color: #ffd700;
    white-space: nowrap;
}
