:root {
    --tabelog-orange: #ec6d1d;
    --tabelog-orange-light: #f39800;
    --tabelog-yellow: #ffc107;
    --tabelog-khaki: #6b6b47;
    --tabelog-green: #5cb85c;
    --tabelog-blue: #0066cc;
    --bg-gray: #f5f5f5;
    --bg-white: #ffffff;
    --text-dark: #333333;
    --text-muted: #666666;
    --text-light: #999999;
    --border-color: #dddddd;
    --border-dark: #cccccc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', Meiryo, メイリオ, sans-serif;
    background: var(--bg-gray);
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.5;
}

/* Header - Tabelog style yellow bar */
.header {
    background: var(--tabelog-yellow);
    padding: 8px 16px;
    border-bottom: 1px solid #e0a800;
}

.header-inner {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-dark);
}

.logo-icon {
    font-size: 20px;
}

.logo-text {
    font-weight: bold;
    font-size: 18px;
}

.logo-text span {
    color: var(--tabelog-orange);
}

.header-date {
    font-size: 12px;
    color: var(--text-dark);
    background: rgba(255,255,255,0.7);
    padding: 4px 10px;
    border: 1px solid var(--border-color);
}

/* Main container */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 8px 16px;
}

/* Score bar */
.score-bar {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-dots {
    display: flex;
    gap: 4px;
}

.progress-dot {
    width: 28px;
    height: 28px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-muted);
}

.progress-dot.active {
    background: var(--tabelog-orange);
    border-color: var(--tabelog-orange);
    color: white;
}

.progress-dot.completed {
    background: var(--tabelog-green);
    border-color: var(--tabelog-green);
    color: white;
}

.progress-dot.failed {
    background: #d9534f;
    border-color: #d9534f;
    color: white;
}

.score-display {
    font-size: 20px;
    font-weight: bold;
    color: var(--tabelog-orange);
}

.score-display span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: normal;
}

/* Restaurant card */
.restaurant-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
}

/* Photo grid - 2 rows x 5 columns like Tabelog */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px;
    background: var(--bg-gray);
}

.photo-grid-item {
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
}

.photo-grid-item:hover {
    border-color: var(--tabelog-orange);
    transform: scale(1.02);
}

.photo-grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox overlay */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    display: flex;
    max-width: 90vw;
    max-height: 90vh;
    gap: 20px;
}

.lightbox-image {
    max-width: 60vw;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-info {
    width: 300px;
    color: white;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    overflow-y: auto;
    max-height: 85vh;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 48px;
    cursor: pointer;
    padding: 20px 15px;
    z-index: 10;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-review {
    font-size: 14px;
    line-height: 1.6;
}

.lightbox-review-author {
    font-weight: bold;
    color: var(--tabelog-orange);
    display: inline;
}

.lightbox-review-date {
    color: #999;
    font-size: 12px;
}

.lightbox-review-text {
    margin-top: 12px;
    font-style: italic;
    white-space: pre-wrap; /* Preserve line breaks */
}

.lightbox-photo-num {
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Review Modal */
.review-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.review-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.review-modal {
    background: white;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
}

.review-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.review-modal-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: bold;
}

.review-modal-title {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.review-modal-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-dark);
    white-space: pre-wrap; /* Preserve line breaks */
}

/* Restaurant info */
.restaurant-info {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.restaurant-name {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 2px;
    color: var(--text-dark);
}

.restaurant-name-jp {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.restaurant-name-jp:empty {
    display: none;
}

/* Info chips - Tabelog style inline */
.info-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
}

.info-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-dark);
}

.info-chip.hidden {
    color: var(--text-light);
}

.info-chip-icon {
    font-size: 12px;
}

.info-chip-label {
    font-weight: bold;
    color: var(--text-muted);
}

/* Description section */
.description-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.description-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-dark);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--tabelog-blue);
}

.restaurant-description {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-dark);
}

.restaurant-description.no-description {
    color: var(--text-light);
    font-style: italic;
}

/* Reviews section */
.reviews-section {
    padding: 16px;
    background: var(--bg-gray);
}

.reviews-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-dark);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--tabelog-khaki);
}

.review-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 12px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-dark);
}

.review-card.hidden {
    background: var(--bg-gray);
    color: var(--text-light);
    border-style: dashed;
    font-style: italic;
}

.review-card.clickable {
    cursor: pointer;
    transition: background-color 0.15s;
}

.review-card.clickable:hover {
    background: #f9f9f9;
}

.review-expand {
    margin-top: 8px;
    font-size: 12px;
    color: var(--tabelog-blue);
    font-weight: bold;
}

.reviews-hint {
    font-size: 11px;
    font-weight: normal;
    color: var(--text-light);
}

.review-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: bold;
}

.review-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.review-text {
    color: var(--text-dark);
}

/* Guess section */
.guess-section {
    padding: 16px;
    background: var(--bg-white);
    border-top: 3px solid var(--tabelog-orange);
}

.guess-header {
    text-align: center;
    margin-bottom: 16px;
}

.guess-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.guess-attempt {
    font-size: 16px;
    font-weight: bold;
    color: var(--tabelog-orange);
}

/* Star Rating Slider */
.rating-slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
}

.rating-display {
    font-size: 48px;
    font-weight: bold;
    color: var(--tabelog-orange);
    line-height: 1;
}

.star-container {
    position: relative;
    font-size: 36px;
    line-height: 1;
    user-select: none;
}

.star-background {
    color: #ddd;
    letter-spacing: 4px;
}

.star-fill {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--tabelog-orange);
    letter-spacing: 4px;
    overflow: hidden;
    white-space: nowrap;
    width: 70%; /* Updated by JS */
}

.slider-wrapper {
    width: 100%;
    max-width: 300px;
}

.rating-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #ddd 0%, var(--tabelog-orange) 70%, #ddd 70%);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--tabelog-orange);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 3px solid white;
}

.rating-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--tabelog-orange);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 3px solid white;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-light);
}

.fine-tune {
    display: flex;
    gap: 8px;
}

.fine-tune-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
}

.fine-tune-btn:hover {
    background: var(--tabelog-orange);
    color: white;
    border-color: var(--tabelog-orange);
}

.fine-tune-btn:active {
    transform: scale(0.95);
}

.rating-hint {
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    margin-top: 8px;
}

.guess-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: bold;
    background: var(--tabelog-orange);
    color: white;
    border: none;
    cursor: pointer;
}

.guess-btn:hover {
    background: #d55a10;
}

.guess-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

/* Feedback */
.feedback {
    text-align: center;
    padding: 16px;
    margin-top: 12px;
    font-weight: bold;
    font-size: 16px;
    border: 2px solid;
    border-radius: 8px;
}

.feedback:empty {
    display: none;
}

.feedback.freezing { background: #e3f2fd; border-color: #1565c0; color: #1565c0; }
.feedback.cold { background: #e8f5e9; border-color: #2e7d32; color: #2e7d32; }
.feedback.warm { background: #fff3e0; border-color: #ef6c00; color: #ef6c00; }
.feedback.hot { background: #ffebee; border-color: #c62828; color: #c62828; }
.feedback.correct { background: #fff8e1; border-color: #f9a825; color: #f57f17; }

.feedback-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.feedback-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-emoji {
    font-size: 32px;
}

.feedback-text {
    font-size: 18px;
}

.feedback-direction {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 24px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
}

.feedback-direction.direction-up {
    background: linear-gradient(135deg, #4caf50, #81c784);
    color: white;
}

.feedback-direction.direction-down {
    background: linear-gradient(135deg, #f44336, #e57373);
    color: white;
}

.direction-arrow {
    font-size: 28px;
    font-weight: bold;
}

.feedback-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: normal;
}

/* Previous guesses */
.previous-guesses {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.previous-guesses:empty {
    display: none;
}

.prev-guess {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid;
    border-radius: 20px;
}

.prev-guess-value {
    font-family: monospace;
}

.prev-guess-arrow {
    font-size: 16px;
    font-weight: bold;
}

.prev-guess.high .prev-guess-arrow { color: #c62828; }
.prev-guess.low .prev-guess-arrow { color: #2e7d32; }

.prev-guess.freezing { background: #e3f2fd; border-color: #1565c0; color: #1565c0; }
.prev-guess.cold { background: #e8f5e9; border-color: #2e7d32; color: #2e7d32; }
.prev-guess.warm { background: #fff3e0; border-color: #ef6c00; color: #ef6c00; }
.prev-guess.hot { background: #ffebee; border-color: #c62828; color: #c62828; }

/* Result overlay */
.result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.result-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.result-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 24px;
    max-width: 360px;
    width: 90%;
    text-align: center;
}

.result-rating {
    font-size: 56px;
    font-weight: bold;
    color: var(--tabelog-orange);
    margin-bottom: 4px;
}

.result-stars {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--tabelog-orange);
}

.result-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.result-message {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.result-points {
    font-size: 28px;
    font-weight: bold;
    color: var(--tabelog-green);
    margin-bottom: 16px;
}

.result-link {
    display: inline-block;
    padding: 10px 20px;
    background: var(--tabelog-orange);
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 8px;
}

.result-link:hover {
    background: #d55a10;
}

.result-next {
    display: block;
    width: 100%;
    padding: 10px 20px;
    background: var(--tabelog-khaki);
    color: white;
    border: none;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 8px;
}

.result-next:hover {
    background: #5a5a3c;
}

/* Final results */
.final-results {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 24px;
    text-align: center;
}

.final-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 8px;
}

.final-score {
    font-size: 64px;
    font-weight: bold;
    color: var(--tabelog-orange);
    line-height: 1;
    margin-bottom: 4px;
}

.final-max {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.share-grid {
    font-family: monospace;
    font-size: 24px;
    line-height: 1.5;
    margin-bottom: 20px;
    background: var(--bg-gray);
    padding: 12px;
    border: 1px solid var(--border-color);
    letter-spacing: 4px;
}

.share-btn {
    padding: 12px 24px;
    background: var(--tabelog-blue);
    color: white;
    border: none;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.share-btn:hover {
    background: #0055aa;
}

/* Loading state */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-muted);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--tabelog-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

/* Error state */
.error-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 800px) {
    .photo-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .lightbox-content {
        flex-direction: column;
        align-items: center;
    }

    .lightbox-image {
        max-width: 90vw;
        max-height: 50vh;
    }

    .lightbox-info {
        width: 90vw;
        max-height: 35vh;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 8px;
    }

    .restaurant-name {
        font-size: 18px;
    }

    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
        padding: 4px;
    }

    .guess-input {
        width: 80px;
        height: 40px;
        font-size: 20px;
    }

    .final-score {
        font-size: 48px;
    }

    .info-chips {
        gap: 8px;
        font-size: 12px;
    }

    .lightbox-nav {
        font-size: 32px;
        padding: 15px 10px;
    }

    .lightbox-prev { left: 5px; }
    .lightbox-next { right: 5px; }
}

/* =====================================================
   HIGHER OR LOWER GAME STYLES
   ===================================================== */

/* Header results display */
.header-results {
    display: flex;
    align-items: center;
}

.header-results .result-squares {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.header-results .result-squares:empty {
    display: none;
}

.header-results .result-square {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

/* Result squares banner (Wordle/Scradle style) */
.result-banner {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.result-squares {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.result-square {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    background: var(--bg-gray);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.result-square.current {
    background: var(--tabelog-yellow);
    border-color: #e0a800;
    color: var(--text-dark);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.result-square.correct {
    background: var(--tabelog-green);
    border-color: #449944;
    color: white;
}

.result-square.incorrect {
    background: #d9534f;
    border-color: #c9302c;
    color: white;
}

/* Streak display (kept for game over screen) */
.streak-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.streak-icon {
    font-size: 28px;
}

.streak-number {
    font-size: 36px;
    font-weight: bold;
    color: var(--tabelog-orange);
}

.streak-label {
    font-size: 14px;
    color: #888;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Comparison container */
.comparison-container {
    width: 100%;
    margin: 0 auto;
    padding-top: 8px;
}

.comparison-question {
    text-align: center;
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-white);
    border: 2px solid var(--tabelog-orange);
    border-radius: 12px;
}

.comparison-question strong {
    color: var(--tabelog-orange);
    font-size: 24px;
}

/* Restaurant grid - side by side */
.restaurants-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: stretch;
}

.restaurants-grid > .restaurant-panel {
    display: flex;
    flex-direction: column;
}

.restaurants-grid > .restaurant-panel .reviews-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.restaurants-grid > .restaurant-panel .reviews-scroll {
    flex: 1;
}

/* VS Divider */
.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: 10px 0;
}

.vs-divider span {
    font-size: 24px;
    font-weight: 900;
    color: var(--tabelog-orange);
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Restaurant panel */
.restaurant-panel {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.restaurant-panel:hover {
    border-color: var(--tabelog-orange);
    box-shadow: 0 8px 30px rgba(236, 109, 29, 0.15);
}

.restaurant-panel.correct {
    border-color: var(--tabelog-green);
    box-shadow: 0 0 0 4px rgba(92, 184, 92, 0.2);
}

.restaurant-panel.wrong {
    border-color: #d9534f;
    box-shadow: 0 0 0 4px rgba(217, 83, 79, 0.2);
}

.restaurant-panel.winner {
    border-color: #ffd700;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.3);
}

.restaurant-panel.winner::before {
    content: '👑';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 30px;
    z-index: 10;
}

/* Winner rating - green like Scrandle */
.revealed-rating.winner-rating {
    background: linear-gradient(135deg, var(--tabelog-green), #449944);
}

.revealed-rating .rating-value {
    font-size: 32px;
    font-weight: bold;
    color: white;
}

/* Panel header */
.panel-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid var(--border-color);
}

.panel-header .restaurant-name {
    font-size: 18px;
    margin-bottom: 2px;
    line-height: 1.2;
}

.panel-header .restaurant-name-jp {
    margin-bottom: 0;
    font-size: 12px;
}

/* Revealed rating - hidden initially */
.revealed-rating {
    display: none;
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--tabelog-orange), #e55a00);
    border-radius: 8px;
    text-align: center;
}

.revealed-rating.show {
    display: block;
    animation: revealPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes revealPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.revealed-rating .rating-value {
    font-size: 32px;
    font-weight: bold;
    color: white;
}

.revealed-rating .rating-stars {
    font-size: 16px;
    color: rgba(255,255,255,0.9);
    margin-top: 4px;
}

/* Panel info chips */
.panel-info {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.panel-info .info-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

/* Photo grid - 2 rows x 5 columns (shows up to 10 photos) */
.photo-grid-6 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
    padding: 8px;
    background: var(--bg-gray);
}

.photo-grid-6 .photo-grid-item {
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.photo-grid-6 .photo-grid-item:hover {
    border-color: var(--tabelog-orange);
}

.photo-grid-6 .photo-grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Empty states */
.no-photos,
.no-reviews {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    background: var(--bg-gray);
    border-radius: 8px;
}

.no-photos {
    grid-column: 1 / -1;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Panel actions (map button) */
.panel-actions {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

.map-btn {
    flex: 1;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-dark);
}

.map-btn:hover {
    background: var(--tabelog-blue);
    color: white;
    border-color: var(--tabelog-blue);
}

/* Scrollable reviews in panel */
.restaurant-panel .reviews-section {
    padding: 8px 12px;
    background: var(--bg-gray);
    border-bottom: 1px solid var(--border-color);
}

.restaurant-panel .reviews-header {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--tabelog-khaki);
    font-size: 13px;
}

.reviews-scroll {
    max-height: clamp(100px, 20vh, 200px);
    overflow-y: auto;
    padding-right: 6px;
}

.reviews-scroll::-webkit-scrollbar {
    width: 6px;
}

.reviews-scroll::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.reviews-scroll::-webkit-scrollbar-thumb {
    background: var(--tabelog-khaki);
    border-radius: 3px;
}

.reviews-scroll .review-card {
    margin-bottom: 6px;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.4;
}

.reviews-scroll .review-card:last-child {
    margin-bottom: 0;
}

.reviews-scroll .review-meta {
    font-size: 10px;
    margin-bottom: 4px;
}

.reviews-scroll .review-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Choose button */
.choose-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: bold;
    background: linear-gradient(135deg, var(--tabelog-orange) 0%, #e55a00 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.choose-btn:hover {
    background: linear-gradient(135deg, #e55a00 0%, #cc4d00 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 109, 29, 0.4);
}

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

.choose-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Map Modal */
.map-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.map-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.map-modal {
    background: white;
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.map-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    z-index: 10;
    transition: all 0.2s ease;
}

.map-modal-close:hover {
    background: #d9534f;
    color: white;
    border-color: #d9534f;
}

.map-modal-title {
    padding: 20px 24px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.map-modal-content {
    padding: 0;
}

.map-modal-content iframe {
    display: block;
    border: none;
}

/* Game Over Screen */
.game-over {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.game-over-title {
    font-size: 32px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 24px;
}

.game-over-title.perfect {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-over-streak,
.game-over-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.score-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.streak-icon-large {
    font-size: 56px;
    animation: flame 0.5s ease-in-out infinite alternate;
}

.final-streak {
    font-size: 64px;
    font-weight: bold;
    color: var(--tabelog-orange);
    line-height: 1;
}

.game-over-message {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* Reveal section */
.reveal-section {
    background: var(--bg-gray);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.reveal-title {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reveal-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
}

.reveal-restaurant {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.reveal-restaurant.winner {
    border-color: var(--tabelog-green);
    background: linear-gradient(135deg, #f0fff0 0%, #e8f5e9 100%);
}

.reveal-restaurant.loser {
    border-color: #d9534f;
    background: linear-gradient(135deg, #fff5f5 0%, #ffebee 100%);
}

.reveal-restaurant .name {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.reveal-restaurant .rating {
    font-size: 28px;
    font-weight: bold;
    color: var(--tabelog-orange);
}

.reveal-restaurant .stars {
    font-size: 12px;
    color: var(--tabelog-orange);
}

.reveal-vs {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-muted);
}

/* Share button in game over */
.game-over .share-btn {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.come-back-text {
    font-size: 14px;
    color: var(--text-light);
    font-style: italic;
}

/* =====================================================
   RESPONSIVE STYLES FOR COMPARISON GAME
   ===================================================== */

@media (max-width: 1200px) {
    .restaurants-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .vs-divider {
        padding: 10px 0;
    }

    .vs-divider span {
        font-size: 28px;
        width: 56px;
        height: 56px;
    }

    .comparison-question {
        font-size: 18px;
    }

    .comparison-question strong {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 12px;
    }

    .header-results .result-squares {
        gap: 3px;
        padding: 3px 6px;
    }

    .header-results .result-square {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .comparison-question {
        font-size: 16px;
        padding: 12px;
    }

    .comparison-question strong {
        font-size: 18px;
    }

    .panel-header .restaurant-name {
        font-size: 18px;
    }

    .photo-grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .choose-btn {
        padding: 14px 20px;
        font-size: 14px;
    }

    .reviews-scroll {
        max-height: 200px;
    }

    .game-over {
        padding: 24px;
    }

    .game-over-title {
        font-size: 24px;
    }

    .final-streak {
        font-size: 56px;
    }

    .streak-icon-large {
        font-size: 42px;
    }

    .reveal-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .reveal-vs {
        font-size: 18px;
    }

    .map-modal {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-results {
        order: 2;
    }

    .header-date {
        order: 3;
        width: 100%;
        text-align: center;
    }

    .header-results .result-squares {
        gap: 2px;
        padding: 2px 4px;
    }

    .header-results .result-square {
        width: 20px;
        height: 20px;
        font-size: 9px;
        border-radius: 4px;
    }

    .panel-header {
        padding: 16px;
    }

    .panel-info {
        padding: 12px 16px;
    }

    .panel-actions {
        padding: 10px 16px;
    }

    .restaurant-panel .reviews-section {
        padding: 12px 16px;
    }

    .info-chips {
        gap: 8px;
    }

    .info-chip {
        font-size: 12px;
    }
}

/* =====================================================
   HOME SCREEN STYLES
   ===================================================== */

.home-screen {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.home-logo {
    font-size: 80px;
    margin-bottom: 16px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.home-title {
    font-size: 36px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.home-subtitle {
    font-size: 18px;
    color: var(--tabelog-orange);
    font-weight: 600;
    margin-bottom: 8px;
}

.home-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 32px;
}

.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.home-btn {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.home-btn.primary {
    background: linear-gradient(135deg, var(--tabelog-orange) 0%, #e55a00 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(236, 109, 29, 0.3);
}

.home-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 109, 29, 0.4);
}

.home-btn.secondary {
    background: var(--bg-white);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.home-btn.secondary:hover {
    border-color: var(--tabelog-orange);
    color: var(--tabelog-orange);
}

.home-btn.small {
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 8px;
    background: var(--tabelog-khaki);
    color: white;
}

.home-btn.small:hover {
    background: #5a5a3c;
}

.home-custom-seed {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
}

.home-custom-seed label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.seed-input-row {
    display: flex;
    gap: 8px;
}

.seed-input-row input {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease;
}

.seed-input-row input:focus {
    border-color: var(--tabelog-orange);
}

.home-footer {
    font-size: 12px;
    color: var(--text-light);
}

.home-footer a {
    color: var(--tabelog-blue);
    text-decoration: none;
}

.home-footer a:hover {
    text-decoration: underline;
}

/* =====================================================
   GAME OVER BUTTON STYLES
   ===================================================== */

.seed-display {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding: 8px 16px;
    background: var(--bg-gray);
    border-radius: 20px;
    display: inline-block;
}

.seed-display span {
    font-weight: bold;
    color: var(--text-dark);
    font-family: monospace;
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 300px;
    margin: 0 auto;
}

.game-over-btn {
    padding: 14px 24px;
    font-size: 15px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-over-btn.primary {
    background: var(--tabelog-blue);
    color: white;
}

.game-over-btn.primary:hover {
    background: #0055aa;
}

.game-over-btn.secondary {
    background: var(--tabelog-orange);
    color: white;
}

.game-over-btn.secondary:hover {
    background: #d55a10;
}

.game-over-btn.tertiary {
    background: var(--bg-gray);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.game-over-btn.tertiary:hover {
    background: var(--border-color);
    color: var(--text-dark);
}

/* Remove old share button styles in game over */
.game-over .share-btn {
    display: none;
}

.reveal-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--tabelog-blue);
    text-decoration: none;
}

.reveal-link:hover {
    text-decoration: underline;
}

/* =====================================================
   RESPONSIVE HOME SCREEN
   ===================================================== */

@media (max-width: 480px) {
    .home-screen {
        padding: 24px 16px;
    }

    .home-logo {
        font-size: 60px;
    }

    .home-title {
        font-size: 28px;
    }

    .home-subtitle {
        font-size: 16px;
    }

    .home-btn {
        padding: 14px 20px;
        font-size: 15px;
    }

    .seed-input-row {
        flex-direction: column;
    }

    .seed-input-row input {
        text-align: center;
    }

    .game-over-buttons {
        max-width: 100%;
    }
}
