:root {
    --bg-color: #f0f2f5; --container-bg: #ffffff; --text-color: #333; --border-color: #ddd;
    --header-text: #007aff; --card-bg: #fafafa; --badge-bg: #e7f3ff; --badge-text: #1877f2;
}
[data-theme="dark"] {
    --bg-color: #121212; --container-bg: #1e1e1e; --text-color: #e0e0e0; --border-color: #333;
    --header-text: #0a84ff; --card-bg: #2a2a2a; --badge-bg: #1a2a3a; --badge-text: #70b5ff;
}
body { font-family: -apple-system, sans-serif; background: var(--bg-color); color: var(--text-color); margin: 0; padding: 10px; transition: 0.3s; }
.container { max-width: 600px; margin: auto; background: var(--container-bg); padding: 20px; border-radius: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); position: relative; }

/* Centered Bold Red Leader Badge */
.leader-banner { text-align: center; width: 100%; margin-bottom: 10px; min-height: 30px; }
.leader-badge { color: #ff0000; font-weight: 900; font-size: 1.6em; letter-spacing: 2px; text-transform: uppercase; }

/* FIXED FLOATING MENUS - Fixes iPad ghosting issues */
#action-menu, #game-settings-menu { 
    position: fixed; 
    display: none; 
    visibility: hidden; 
    background: var(--container-bg); 
    border-radius: 12px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.4); 
    z-index: 99999; 
    width: 220px; 
    border: 1px solid var(--border-color); 
    overflow: hidden;
}
.menu-item { 
    padding: 18px 20px; 
    border-bottom: 1px solid var(--border-color); 
    cursor: pointer; 
    font-size: 18px; 
    color: var(--text-color); 
    background: var(--container-bg);
    text-align: left;
    display: block;
    width: 100%;
    box-sizing: border-box;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--card-bg); }
.menu-item.danger { color: #dc3545; font-weight: bold; }

.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; font-weight: bold; color: var(--header-text); border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.prompt-container { display: flex; flex-direction: row; gap: 10px; justify-content: center; align-items: center; margin-bottom: 25px; width: 100%; }
.prompt-box { background: #4ca3ff; color: white; flex: 1; height: 100px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1.4em; border-radius: 12px; text-transform: uppercase; text-align: center; padding: 10px; box-sizing: border-box; }
.user-submitted-fill { text-decoration: underline; font-weight: 900; color: #ffffff; }

input[type="text"] { width: 100%; padding: 20px; margin: 15px 0; border: 3px solid var(--border-color); border-radius: 15px; background: var(--container-bg); color: var(--text-color); box-sizing: border-box; font-size: 18px; text-align: center; outline: none; }
button { width: 100%; padding: 18px; border: none; border-radius: 15px; background: #007aff; color: white; font-weight: bold; cursor: pointer; margin-top: 10px; font-size: 18px; }
.theme-toggle { position: fixed; bottom: 20px; left: 20px; width: 55px; height: 55px; border-radius: 50%; background: #007aff; color: white; display: flex; align-items: center; justify-content: center; font-size: 26px; z-index: 2000; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }

.score-table { width: 100%; border-collapse: collapse; margin-top: 15px; background: var(--card-bg); border-radius: 10px; overflow: hidden; }
.score-table td { padding: 12px; border-bottom: 1px solid var(--border-color); color: var(--text-color); }
.settings-icon { cursor: pointer; margin-right: 12px; font-size: 22px; padding: 8px; background: var(--border-color); border-radius: 50%; vertical-align: middle; line-height: 1; }
.match-2 { color: #28a745; font-weight: bold; }
.match-3 { color: #007aff; font-weight: bold; }