/* CLS Fix: Metric-compatible fallback font for Roboto */
@font-face {
  font-family: 'Roboto Fallback';
  src: local('Arial');
  ascent-override: 92.8%;
  descent-override: 24.4%;
  line-gap-override: 0%;
  size-adjust: 104.2%;
}

:root {
    --banker-color: #ff5252; 
    --player-color: #448aff;
    --tie-color: #1de9b6;    
    --bg-dark: #1f2937; 
    --bg-light: #374151; 
    --text-color: #f3f4f6; 
    --accent-color: #f59e0b;
    --text-color-subtle: #d1d5db;
    --text-color-on-accent: #ffffff;
}
body {
    font-family: 'Roboto', 'Roboto Fallback', sans-serif; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-dark);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}
.container {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-light);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
}
.language-switcher {
    position: absolute;
    top: 10px;
    right: 15px;
    display: flex;
    gap: 5px;
}
.language-switcher button {
    background-color: #4b5563;
    color: var(--text-color);
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}
.language-switcher button:hover { background-color: #6b7280; }
.language-switcher button.active {
    background-color: var(--accent-color);
    color: var(--bg-dark);
}
h1 { margin: 10px 0 0 0; font-size: 1.7em; }
.app-description {
    font-size: 0.9em;
    color: #bdc1c6;
    margin: 5px 0 20px 0;
    line-height: 1.4;
}
.mode-toggles { border-bottom: 1px solid #4b5563; padding-bottom: 12px; margin-bottom: 12px; }
.mode-switcher { display: flex; justify-content: center; align-items: center; margin: 10px 0; user-select: none; }
.switch { position: relative; display: inline-block; width: 50px; height: 26px; margin: 0 10px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #6b7280; transition: .4s; border-radius: 26px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(24px); }
.info-text { font-size: 0.8em; color: var(--text-color-subtle); min-height: 18px; margin: 0; }

@keyframes shimmer {
    0% { transform: translateX(-150%) skewX(-30deg); }
    100% { transform: translateX(150%) skewX(-30deg); }
}
.main-button { 
    font-size: 1.3em; font-weight: bold; padding: 15px 30px; cursor: pointer; border: none; 
    background-color: var(--accent-color); color: var(--bg-dark); border-radius: 8px; 
    transition: transform 0.1s ease; width: 100%; margin-top: 10px;
    position: relative; overflow: hidden;
}
.main-button::before {
    content: ''; position: absolute; top: 0; left: 0; width: 50%; height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    animation: shimmer 3s infinite linear;
}
.main-button:active { transform: scale(0.98); }
.main-button:disabled { background-color: #9ca3af; cursor: not-allowed; }
.main-button:disabled::before { animation: none; }

.control-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 15px; padding-top: 15px; border-top: 1px solid #4b5563; }
.control-panel h2 { grid-column: 1 / -1; margin: 0 0 10px 0; font-size: 1.2em; color: var(--text-color-subtle);}
.control-button { padding: 10px; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; background-color: #4b5563; color: var(--text-color); transition: background-color 0.2s; }
.control-button.span-all { grid-column: 1 / -1; }
.control-button:hover { background-color: #6b7280; }
.reset-button { background-color: var(--banker-color); color: var(--text-color-on-accent); }
.result-display { font-size: 3.5em; font-weight: bold; margin: 12px 0; min-height: 70px; display: flex; justify-content: center; align-items: center; border-radius: 8px; padding: 10px; }
.banker { color: var(--banker-color); } .player { color: var(--player-color); } .tie { color: var(--tie-color); }
@keyframes thinking { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
.thinking { animation: thinking 0.5s infinite; }

.stats-grid { 
    display: grid; grid-template-columns: 1fr; gap: 12px; 
    margin-top: 15px; padding-top: 15px; border-top: 1px solid #4b5563;
    min-height: 250px; 
}
.stats-grid h2 { grid-column: 1 / -1; margin: 0 0 5px 0; font-size: 1.2em; color: var(--text-color-subtle); }
.counters { display: flex; justify-content: space-around; grid-column: 1 / -1; margin-bottom: 10px; }
.counter-item { font-size: 1.4em; font-weight: bold; }
.counter-item span { 
    display: block; font-size: 0.6em; font-weight: normal; 
    color: var(--text-color);
    opacity: 0.8;
}
.streaks { text-align: center; }
.streaks p { margin: 5px 0; }
.streaks span { font-weight: bold; }
.history { margin-top: 10px; }
.history-log { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 0; margin: 0; list-style-type: none; }
.history-item { 
    width: 30px; height: 30px; border-radius: 50%; 
    display: flex; justify-content: center; align-items: center; 
    font-weight: bold; 
    color: var(--bg-dark); 
}
.history-item.banker { background-color: var(--banker-color); } 
.history-item.player { background-color: var(--player-color); } 
.history-item.tie { background-color: var(--tie-color); }

footer {
    width: 100%;
    max-width: 420px;
    margin-top: 10px;
}
.affiliate-section { 
    padding: 15px;
    border-top: 1px solid #4b5563; 
    text-align: center; 
    background-color: var(--bg-light);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}
.affiliate-section h2 { margin: 0 0 10px 0; font-size: 1em; color: var(--text-color-subtle); font-weight: normal; }
.affiliate-section a {
    display: inline-block; background-color: var(--accent-color); color: var(--bg-dark); padding: 10px 20px;
    border-radius: 8px; text-decoration: none; font-weight: bold; transition: transform 0.2s;
}
.affiliate-section a:hover { transform: scale(1.05); }
.affiliate-section p { font-size: 0.8em; color: var(--text-color-subtle); margin: 10px 0 0 0; }
