:root {
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text: #111827;
    --primary: #059669;
    --primary-light: #d1fae5;
    --border: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 900px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.highlight {
    color: var(--primary);
}

.subtitle {
    color: #6b7280;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #4b5563;
}

.currency-input {
    position: relative;
}

.currency-symbol {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.2rem;
}

input[type="number"] {
    width: 100%;
    padding: 1rem 1rem 1rem 2.5rem;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    font-size: 1.5rem;
    font-family: inherit;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
    background: #f9fafb;
}

input[type="number"]:focus {
    border-color: var(--primary);
    background: white;
}

.tip-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr) 1fr;
    gap: 0.5rem;
}

.tip-btn {
    padding: 0.75rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tip-btn.active,
.tip-btn:hover,
.tip-btn:focus {
    background: var(--primary);
    color: white;
    outline: none;
}

.tip-custom {
    padding: 0.5rem !important;
    font-size: 1rem !important;
    text-align: center;
}

.people-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.5rem;
}

.control-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    color: var(--primary);
}

.control-btn:hover,
.control-btn:focus {
    background: #f3f4f6;
    outline: none;
}

#people-count-display {
    font-size: 1.5rem;
    font-weight: 800;
}

/* Result Section */
.result-section {
    background: var(--primary);
    border-radius: 1rem;
    padding: 2rem;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.result-row .label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.result-row .value {
    font-size: 1.5rem;
    font-weight: 600;
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 1rem 0 2rem;
}

.highlight-row .value.big {
    font-size: 3rem;
    font-weight: 800;
    color: #a7f3d0;
}

.secondary-btn {
    width: 100%;
    padding: 1rem;
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: var(--primary-light);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.wheel-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 2rem auto;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid var(--primary);
    background: conic-gradient(#fca5a5 0deg 60deg,
            #fdba74 60deg 120deg,
            #fcd34d 120deg 180deg,
            #86efac 180deg 240deg,
            #93c5fd 240deg 300deg,
            #c4b5fd 300deg 360deg);
    transition: transform 3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.arrow {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: #374151;
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 1rem;
}

.text-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    text-decoration: underline;
}

.winner-text {
    margin-top: 1rem;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
    min-height: 1.5em;
}