:root {
    --primary: #1e3a8a;
    --primary-light: #3b82f6;
    --accent: #dc2626;
    --bg-top: #7dd3fc;
    --bg-mid: #e0f2fe;
    --bg-bot: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(30, 58, 138, 0.15);
    --radius: 16px;
    --radius-sm: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 40%, var(--bg-bot) 100%);
    background-attachment: fixed;
    color: var(--text);
    font-size: 18px;
    line-height: 1.5;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px;
}

.header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 8px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.rolc-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
    font-style: italic;
}

.rolc-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 2px;
    margin-left: 2px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 3px;
    margin-top: 4px;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    text-align: center;
}

.card-subtitle {
    font-size: 1rem;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

input[type="text"],
select {
    width: 100%;
    padding: 16px 18px;
    font-size: 1.15rem;
    border: 2px solid #cbd5e1;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

input[type="text"]:focus,
select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231e3a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 22px;
    padding-right: 48px;
}

.btn {
    display: block;
    width: 100%;
    padding: 18px 24px;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    margin-top: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn-primary:hover {
    opacity: 0.95;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text);
    border: 2px solid #cbd5e1;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.welcome-box {
    text-align: center;
    margin-bottom: 24px;
}

.welcome-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.welcome-label {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-top: 4px;
}

.event-block {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #cbd5e1;
}

.event-block:last-of-type {
    border-bottom: none;
    margin-bottom: 8px;
}

.event-prompt {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.match-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

.match-item {
    padding: 16px 18px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.match-item:hover,
.match-item.selected {
    background: #eff6ff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.match-item.selected::after {
    content: "✓";
    float: right;
    color: var(--primary);
    font-weight: 800;
}

.error-box {
    text-align: center;
    padding: 24px;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.error-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.success-box {
    text-align: center;
    padding: 32px 20px;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

.success-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.success-detail {
    font-size: 1rem;
    color: var(--text-light);
}

.loading {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--primary);
    color: var(--white);
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.3);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    background: #dc2626;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
}

.toast.success {
    background: #16a34a;
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.3);
}

.footer {
    text-align: center;
    padding-top: 24px;
    margin-top: auto;
}

.verse {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.5;
    font-style: italic;
    max-width: 340px;
    margin: 0 auto 6px;
}

.verse-ref {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}

.org-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding-bottom: 12px;
}

.org {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.7;
}

.org-icon {
    font-size: 1.2rem;
    color: var(--primary);
}

.org-text {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    text-align: left;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.version {
    font-size: 0.7rem;
    color: var(--text-light);
    opacity: 0.6;
    margin-top: 12px;
    letter-spacing: 1px;
}

.hidden {
    display: none !important;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }

@media (min-width: 400px) {
    .container {
        padding: 32px 28px;
    }
    .card {
        padding: 32px 28px;
    }
}