* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --primary-color: #00E5CC;
    --primary-dark: #00C4AD;
    --bg-dark: #0A1628;
    --bg-card: #1A2332;
    --text-primary: #FFFFFF;
    --text-secondary: #8B9BAB;
    --border-color: #2A3A4A;
}
body, button {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Custom Dialog Styles */
.custom-dialog {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

.custom-dialog[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-dialog::backdrop {
    background: rgba(10, 22, 40, 0.8);
    backdrop-filter: blur(4px);
}

.dialog-content {
    padding: 2rem;
}

.dialog-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.dialog-message {
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: center;
}

.dialog-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.dialog-buttons .btn-primary,
.dialog-buttons .btn-secondary {
    flex: 1 1 0;
    min-width: 0;
    padding: 1rem;
    font-size: 1.1rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.dialog-buttons .btn-primary:active,
.dialog-buttons .btn-secondary:active {
    transform: scale(0.95);
}

h1,h2,h3,h4{
    overflow-wrap: break-word;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0A1628 0%, #1A3A4A 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 2000px;
    padding: 2rem;
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
}

.logo {
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.progress-indicator {
    text-align: right;
}

.progress-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.progress-step {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Setup Container */
.setup-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.setup-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 3rem;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.setup-badge {
    display: inline-block;
    background: rgba(0, 229, 204, 0.1);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.setup-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.setup-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Form */
/* 選択中の競技表示 */
.selected-competition-display {
    margin-bottom: 2rem;
}

.current-competition {
    background: rgba(0, 229, 204, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.current-competition-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.current-competition-name {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.competition-grid-container {
    margin-bottom: 2rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1rem;
}

.competition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-height: 450px;
    overflow-y: auto;
    padding: 0.5rem;
}

.competition-grid::-webkit-scrollbar {
    width: 8px;
}

.competition-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.competition-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.competition-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60px;
}

.competition-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 229, 204, 0.2);
}

.competition-card.selected {
    background: rgba(0, 229, 204, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 229, 204, 0.2);
}

.competition-name {
    font-size: 1rem;
    line-height: 1.4;
    color: var(--text-primary);
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    width: 100%;
    background: var(--primary-color);
    color: var(--bg-dark);
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 229, 204, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 0.75rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(0, 229, 204, 0.1);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-secondary svg {
    transition: transform 0.3s ease;
}

.btn-secondary.active svg {
    transform: rotate(180deg);
}

.btn-warning {
    width: 100%;
    background: transparent;
    color: #f59e0b;
    border: 2px solid #f59e0b;
    border-radius: 0.75rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.btn-warning:active {
    transform: scale(0.95);
    background: rgba(245, 158, 11, 0.15);
}

.btn-warning svg {
    transition: transform 0.3s ease;
}

.btn-warning:hover svg {
    transform: rotate(-30deg);
}

/* Quick Presets */
.quick-presets {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.presets-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    text-align: center;
}

.preset-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Confirm Screen */
.confirm-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    color: white;
}

.confirm-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.confirm-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.confirm-item:first-child {
    padding-top: 0;
}

.confirm-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.confirm-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
}

.confirm-note {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: rgba(0, 229, 204, 0.05);
    border: 1px solid rgba(0, 229, 204, 0.2);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.confirm-note svg {
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.confirm-note p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.flow-section {
    margin-top: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.completed-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #10b981;
    color: #ffffff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    gap: 0.9rem;
}

.color-card {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    font-weight: 700;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.color-card.green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.color-card.red { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.color-card.white {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #1f2937;
}
.color-card.yellow { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); }
.color-card.orange { background: linear-gradient(135deg, #fb923c 0%, #f97316 100%); }
.color-card.blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

.color-card.selected {
    box-shadow: 0 0 0 4px rgba(0, 229, 204, 0.35);
}

.rank-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(10, 22, 40, 0.9);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
}

.rank-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

.rank-table th,
.rank-table td {
    padding: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.rank-table thead {
    background: rgba(255, 255, 255, 0.06);
}

.button-group {
    display: flex;
    gap: 1rem;
}

.button-group .btn-secondary,
.button-group .btn-warning,
.button-group .btn-primary {
    flex: 1 1 0;
    min-width: 0;
}

/* Step Indicators */
.step-indicators {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.indicator {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--primary-color);
    width: 1.5rem;
    border-radius: 0.25rem;
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-align: center;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .progress-indicator {
        text-align: center;
    }

    .setup-card {
        padding: 2rem 1.5rem;
    }

    .setup-title {
        font-size: 1.5rem;
    }

    .preset-buttons {
        flex-direction: column;
    }

    .preset-btn {
        width: 100%;
    }
}

/* Complete Page - 総合順位表 */
.rankings-container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.standings-table thead {
    background: linear-gradient(135deg, #00E5CC 0%, #00C4AD 100%);
}

.standings-table th {
    padding: 1.25rem 1rem;
    text-align: center;
    color: #0A1628;
    font-weight: 700;
    font-size: 1.1rem;
}

.standings-table td {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.1rem;
    color: var(--text-primary);
}

.standings-table tbody tr:last-child td {
    border-bottom: none;
}

.standings-table tbody tr:hover {
    background: rgba(0, 229, 204, 0.05);
}

.rank-column {
    font-weight: 700;
    font-size: 1.8rem;
    width: 100px;
}

.standings-table tbody tr:nth-child(1) .rank-column {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.standings-table tbody tr:nth-child(2) .rank-column {
    color: #9ca3af;
    text-shadow: 0 0 10px rgba(156, 163, 175, 0.5);
}

.standings-table tbody tr:nth-child(3) .rank-column {
    color: #fb923c;
    text-shadow: 0 0 10px rgba(251, 146, 60, 0.5);
}

.color-column {
    font-weight: 600;
    font-size: 1.5rem;
}

.color-badge-inline {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-badge-inline.green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.color-badge-inline.red { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.color-badge-inline.white { 
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%); 
    color: #1f2937;
    text-shadow: none;
}
.color-badge-inline.yellow { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); }
.color-badge-inline.orange { background: linear-gradient(135deg, #fb923c 0%, #f97316 100%); }
.color-badge-inline.blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

.points-column {
    font-weight: 700;
    font-size: 2rem;
    color: var(--primary-color);
}

.action-buttons {
    margin-top: 3rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.update-info {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 綱引き専用スタイル */
.court-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.court-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.court-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 229, 204, 0.2);
}

.court-card.selected {
    background: rgba(0, 229, 204, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 229, 204, 0.2);
}

.court-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.court-classes {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.rank-selection-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin: 2rem 0;
}

.rank-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    scroll-margin-top: 2rem;
    transition: all 0.3s ease;
}

.rank-section[data-rank-id]:not([style*="display: none"]) {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rank-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.rank-section-label {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rank-section-label.rank-1st { 
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}
.rank-section-label.rank-2nd { 
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}
.rank-section-label.rank-3rd { 
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}
.rank-section-label.rank-4th { 
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}
.rank-section-label.rank-5th { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.selected-class-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-radius: 12px;
    min-width: 180px;
    text-align: center;
    border: 3px solid transparent;
}

.selected-class-display.has-selection {
    color: var(--primary-color);
    background: rgba(0, 229, 204, 0.15);
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 229, 204, 0.3);
}

.class-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem;
}

.class-button {
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.class-button:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 229, 204, 0.2);
}

.class-button:active:not(.disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 229, 204, 0.3);
}

.class-button.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-color);
    color: var(--bg-dark);
    box-shadow: 0 0 0 4px rgba(0, 229, 204, 0.4), 0 8px 16px rgba(0, 229, 204, 0.3);
    transform: scale(1.05);
    font-size: 2.2rem;
}

.class-button.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--border-color);
}

@media (max-width: 768px) {
    .rank-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .selected-class-display {
        width: 100%;
        font-size: 1.8rem;
    }
    
    .class-selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1.25rem;
    }
    
    .class-button {
        padding: 1.75rem 1.25rem;
        font-size: 1.75rem;
        min-height: 70px;
    }
    
    .rank-section {
        padding: 1.5rem;
    }
}

.rank-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rank-label {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rank-label.rank-1st { 
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}
.rank-label.rank-2nd { 
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    box-shadow: 0 4px 12px rgba(156, 163, 175, 0.3);
}
.rank-label.rank-3rd { 
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.3);
}
.rank-label.rank-4th { 
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.rank-label.rank-5th { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.color-select {
    padding: 1.25rem;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300E5CC' 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 1rem center;
    background-size: 1.5em 1.5em;
    padding-right: 3.5rem;
    font-weight: 600;
}

.color-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 229, 204, 0.1);
}

.color-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.75rem;
    font-size: 1.25rem;
}

.color-points-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.color-point-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-label {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-label.color-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.color-label.color-red { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.color-label.color-white { 
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%); 
    color: #1f2937;
    text-shadow: none;
}
.color-label.color-yellow { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); }
.color-label.color-orange { background: linear-gradient(135deg, #fb923c 0%, #f97316 100%); }
.color-label.color-blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

.rank-select {
    padding: 1rem;
    font-size: 1.25rem;
    text-align: center;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300E5CC' 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 0.75rem center;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
}

.rank-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 229, 204, 0.1);
}

.rank-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem;
}

.point-input {
    padding: 1rem;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.point-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 229, 204, 0.1);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.button-group button {
    flex: 1;
}

@media (max-width: 768px) {
    .color-points-container {
        grid-template-columns: 1fr;
    }
}

/* 綱引き確認画面スタイル */
.tsunahiki-points-display {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.rank-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rank-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.rank-result-item:hover {
    border-color: var(--primary-color);
    background: rgba(0, 229, 204, 0.05);
}

.result-rank {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 100px;
    text-align: center;
}

.result-rank.rank-1st-badge { 
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}
.result-rank.rank-2nd-badge { 
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}
.result-rank.rank-3rd-badge { 
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}
.result-rank.rank-4th-badge { 
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}
.result-rank.rank-5th-badge { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.result-color {
    flex: 1;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.class-badge {
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 1.5rem;
    font-weight: 700;
}

.class-badge.green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.class-badge.red { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.class-badge.white { 
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%); 
    color: #1f2937 !important;
    text-shadow: none;
}
.class-badge.yellow { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); }
.class-badge.orange { background: linear-gradient(135deg, #fb923c 0%, #f97316 100%); }
.class-badge.blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

.color-badge-small {
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-badge-small.green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.color-badge-small.red { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.color-badge-small.white { 
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%); 
    color: #1f2937 !important;
    text-shadow: none;
}
.color-badge-small.yellow { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); }
.color-badge-small.orange { background: linear-gradient(135deg, #fb923c 0%, #f97316 100%); }
.color-badge-small.blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

.result-points {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 80px;
    text-align: right;
}

.points-title {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.points-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.point-display-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
}

.rank-display {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
}

.point-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-left: auto;
}

.point-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .points-grid {
        grid-template-columns: 1fr;
    }
}

/* 送信画面スタイル */
.loading-spinner {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 229, 204, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-icon,
.error-icon {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.success-title {
    color: #10b981 !important;
}

.error-title {
    color: #ef4444 !important;
}

.error-message {
    color: #ef4444;
}

.setup-badge.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.result-summary {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.summary-title {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: var(--text-secondary);
}

.summary-value {
    font-weight: 600;
    color: var(--text-primary);
}

.points-summary {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.point-summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 8px;
}

.summary-points {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-left: auto;
}

@media (max-width: 768px) {
    .points-summary {
        grid-template-columns: 1fr;
    }
}

/* 順位表ローディング表示 */
.loading-message {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.loading-message p {
    margin-top: 1rem;
    font-size: 1.125rem;
    line-height: 1.8;
}
