/* Base & Native Font Stack */
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: #f4f4f9; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
header { background: #333; color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; }
header h2 { margin: 0; font-size: 1.2rem; }
.logout-btn { color: #40E0D0; text-decoration: none; font-weight: bold; padding: 8px 12px; }

/* Tabs */
.tabs { display: flex; justify-content: center; background: #e0e0e0; padding-top: 10px; }
.tablink { background-color: inherit; border: none; outline: none; cursor: pointer; padding: 14px 20px; font-size: 16px; font-weight: bold; border-radius: 8px 8px 0 0; transition: 0.3s; flex: 1; max-width: 250px; text-align: center; }
.tablink:hover { background-color: #ccc; }
.tablink.active { background-color: white; border-bottom: 3px solid #1E90FF; color: #1E90FF; }

/* Layout Containers */
.container { display: flex; max-width: 900px; margin: 0 auto 30px auto; background: white; padding: 25px; border-radius: 0 0 8px 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); min-height: 450px; }
.input-panel { flex: 1; padding-right: 20px; }
.canvas-panel { flex: 1; display: flex; justify-content: center; align-items: center; }

/* Wheel Canvas Scaling */
canvas { max-width: 100%; height: auto; touch-action: manipulation; }

/* Input Styling (16px font prevents iOS zoom) */
.input-group { margin-bottom: 12px; display: flex; align-items: center; width: 100%; }
.input-group label { width: 30px; font-weight: bold; color: #555; }
.choice-entry { padding: 12px; flex: 1; border: 1px solid #ccc; border-radius: 6px; font-size: 16px; box-sizing: border-box; }

#spin-btn { margin-top: 15px; padding: 15px; background: #28a745; color: white; font-size: 18px; font-weight: bold; border: none; border-radius: 8px; cursor: pointer; width: 100%; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: 0.1s; }
#spin-btn:hover { background: #218838; }
#spin-btn:active { transform: translateY(2px); box-shadow: none; }

/* Groups & History */
.history-item { padding: 12px; border-bottom: 1px solid #eee; }
.history-item span { font-size: 0.85em; color: #888; display: block; margin-bottom: 4px; }
.group-action-row { display: flex; align-items: center; width: 100%; }
.group-input { padding: 12px; font-size: 16px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; flex: 1; }
.group-btn { padding: 12px 15px; border: none; border-radius: 6px; cursor: pointer; font-size: 15px; font-weight: bold; margin-left: 10px; white-space: nowrap; }
.btn-blue { background: #1E90FF; color: white; }
.btn-red { background: #D81E05; color: white; }
.btn-green { background: #28a745; color: white; }

/* MOBILE RESPONSIVE OVERRIDES */
@media (max-width: 768px) {
    /* Stack the wheel above the inputs */
    #Wheel.tabcontent { flex-direction: column-reverse !important; }
    .container { padding: 15px; border-radius: 0; box-shadow: none; }
    .input-panel { padding-right: 0; width: 100%; }
    .canvas-panel { width: 100%; margin-bottom: 25px; }
    
    /* Optimize touch targets for tabs */
    .tablink { padding: 12px 5px; font-size: 15px; }
    
    /* Stack group buttons so they don't squish */
    .group-action-row { flex-direction: column; align-items: stretch; }
    .group-btn { margin: 10px 0 0 0; width: 100%; }
}
