/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0px 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-title {
    flex: 1;
}

.title-with-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 64px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

.header-title h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5rem;
    text-align: left;
    margin: 0;
}

.header-title p {
    color: #7f8c8d;
    font-size: 1.1rem;
    text-align: left;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 20px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
}

.guru-signature-display {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    padding: 4px 8px;
    background: #e8f4fd;
    border-radius: 12px;
    border: 1px solid #3498db;
}

.guru-label {
    font-size: 12px;
    color: #2980b9;
    font-weight: 500;
}

.guru-signature-name {
    font-size: 13px;
    font-weight: 600;
    color: #3498db;
    cursor: pointer;
    transition: color 0.2s;
}

.guru-signature-name:hover {
    color: #2980b9;
    text-decoration: underline;
}

.logout-btn {
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Sections */
section, .login-section {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

section h2, .login-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Login section */
.login-section {
    text-align: center;
    max-width: 500px;
    margin: 0 auto 30px;
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #333;
    border: 2px solid #ddd;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px auto;
}

.google-login-btn:hover {
    border-color: #4285f4;
    box-shadow: 0 2px 10px rgba(66, 133, 244, 0.1);
}

/* Remember me option */
.remember-me-option {
    margin-top: 15px;
    text-align: left;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
    cursor: pointer;
}

.checkbox-label:hover {
    color: #333;
}

/* Input group */
.input-group {
    display: flex;
    gap: 15px;
    align-items: end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.input-group label {
    font-weight: 600;
    color: #34495e;
    margin-bottom: 5px;
    display: block;
}

.input-group input {
    flex: 1;
    min-width: 300px;
    padding: 12px;
    border: 2px solid #e0e6ed;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Recent Pods */
.recent-pods-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.recent-pods-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.recent-section-header {
    margin: 15px 0 10px 0;
    padding-top: 10px;
    color: #2c3e50;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-top: 1px solid #dee2e6;
}

.recent-section-header:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.recent-pods-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.recent-pod-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-pod-item:hover {
    background: #e3f2fd;
    border-color: #3498db;
    transform: translateY(-1px);
}

.recent-hub-item {
    border-left: 3px solid #3498db;
}

.recent-hub-item:hover {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.recent-hub-item.expanded {
    background: #e3f2fd;
    border-left-color: #2196f3;
}

.recent-hub-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.hub-expand-icon {
    display: inline-block;
    font-size: 10px;
    margin-right: 4px;
    transition: transform 0.2s ease;
}

/* Hub actions (refresh and remove buttons) */
.hub-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hub-refresh-btn {
    color: #3498db;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    opacity: 0.7;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hub-refresh-btn:hover {
    opacity: 1;
    background: #e3f2fd;
}

.hub-refresh-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.hub-refresh-btn.refreshing svg {
    animation: spin 1s linear infinite;
}

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


/* Hub pods list */
.hub-pods-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-left: 20px;
    margin-bottom: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.hub-pod-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 12px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 100px;
    aspect-ratio: 1;
    position: relative;
}

.hub-pod-item:hover {
    background: #e7f3ff;
    border-color: #90caf9;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hub-pod-missing {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: not-allowed;
    min-height: 100px;
    aspect-ratio: 1;
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.hub-pod-missing .hub-pod-name {
    color: #adb5bd;
}

.hub-pod-missing .hub-pod-meta {
    color: #adb5bd;
}

.hub-pod-info {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.hub-pod-name {
    font-weight: 700;
    color: #2c3e50;
    font-size: 16px;
    line-height: 1.3;
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
}

.hub-pod-meta {
    font-size: 16px;
    color: #6c757d;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hub-pod-status {
    color: #856404;
    font-weight: 500;
}

.hub-pod-status-ok {
    color: #155724;
    font-size: 18px;
    font-weight: 600;
}

.hub-pods-empty {
    grid-column: 1 / -1;
    padding: 12px;
    color: #6c757d;
    font-style: italic;
    font-size: 13px;
    text-align: center;
}

.hub-pods-error {
    margin-left: 20px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 13px;
}

.recent-pod-info {
    flex: 1;
}

.recent-pod-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.recent-pod-meta {
    font-size: 12px;
    color: #6c757d;
}

.recent-pod-remove {
    color: #dc3545;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.recent-pod-remove:hover {
    opacity: 1;
    background: #f8d7da;
}

.section-divider {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin: 15px 0 5px 0;
    position: relative;
}

.section-divider::before,
.section-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #dee2e6;
}

.section-divider::before {
    left: 0;
}

.section-divider::after {
    right: 0;
}

/* Buttons */
.primary-btn, .secondary-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.primary-btn {
    background-color: #3498db;
    color: white;
}

.primary-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.secondary-btn {
    background-color: #95a5a6;
    color: white;
}

.secondary-btn:hover {
    background-color: #7f8c8d;
    transform: translateY(-2px);
}

.primary-btn:disabled, .secondary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.exit-btn {
    color: red;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.exit-btn:hover {
    color: darkred;
}

.discrepancy-btn {
    background-color: #e74c3c;
    color: white;
}
.discrepancy-btn:hover {
    background-color: #c0392b;
}

/* Guru Signature Section */
.guru-signature-section {
    background: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.guru-signature-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.guru-signature-section p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.guru-info {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.guru-info p {
    color: #155724;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.guru-info strong {
    color: #0d4e1b;
    font-weight: 600;
}

/* Status message, located in the top center */
.status-message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.status-message.loading {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

.status-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* Editor section */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-left h2 {
    margin: 0;
    color: #2c3e50;
}

.analysis-progress {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #6c757d;
}

.analysis-progress span {
    background: #f8f9fa;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.analysis-progress #current-row-info {
    cursor: pointer;
}

#current-row-info:hover, #current-row-info:focus {
    background: #e3f2fd;
    border-color: #90caf9;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.08);
    outline: none;
}

.small-text {
    font-size: 0.7em;
    opacity: 0.6;
    color: black;
    text-decoration: none;
    display: block;
}

/* Guru Color Dropdown Styles */
/* Guru Color Trigger (clickable area for dropdown) */
.guru-color-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.guru-color-trigger:hover, .guru-color-trigger:focus {
    background: #e3f2fd;
    border-color: #90caf9;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.08);
    outline: none;
}


.guru-color-selector {
    position: relative;
    display: inline-block;
}

.guru-color-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    pointer-events: none;
    display: none;
}

.guru-color-dropdown.show {
    opacity: 1;
    transform: translateY(-100%);
    pointer-events: auto;
    display: block;
}

.guru-color-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guru-color-option:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}

.guru-color-option:first-child {
    border-radius: 6px 6px 0 0;
}

.guru-color-option:hover {
    background-color: #f8f9fa;
}

.guru-color-option.current {
    background-color: #e3f2fd;
    font-weight: 500;
}

.guru-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.guru-color-indicator.red {
    background-color: #dc3545;
}
.guru-color-indicator.blue {
    background-color: #007bff;
}
.guru-color-indicator.green {
    background-color: #28a745;
}

.editor-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Low-emphasis diagnostic-log download control. Deliberately not a
   `.secondary-btn`: it must not compete with Refresh / Exit or change the row
   height. Pushed to the far end of the row so the primary pair stays grouped. */
.log-download-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #8a949b;
    font-size: 0.8rem;
    font-family: inherit;
    padding: 4px 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 4px;
    line-height: 1;
}

.log-download-btn:hover {
    color: #495057;
    text-decoration: underline;
}

.log-download-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Overview Table Modal Styles */
.overview-table-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.45);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.overview-table-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    max-width: 90vw;
    min-width: 70em;
    max-height: 80vh;
    overflow: auto;
    position: relative;
}
.overview-table {
    --overview-table-head-offset: 44px;
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    background: white;
}
.overview-table th, .overview-table td {
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 12px;
    text-align: left;
}
.overview-table th {
    background: #f5f7fa;
    font-weight: 700;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 3;
}
.overview-table tr {
    cursor: pointer;
}
.overview-table tr.current-row {
    background: #bbdefb;
    font-weight: bold;
}
.overview-table tr.current-guru-row {
    background: #e8f5e8;
}
.overview-table tr.current-row.current-guru-row {
    background: #bbdefb;
    font-weight: bold;
}
.overview-table tr[data-row]:hover {
    background: #e3f2fd;
}
.overview-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 25vw;
}
.overview-table .match-status-cell {
    width: 5rem;
    text-align: center;
}
/* Columns that only appear when there is room for them. */
.overview-table .overview-table-optional {
    display: none;
}
@media (min-width: 1001px) {
    .overview-table .overview-table-optional {
        display: table-cell;
    }
}
.overview-table .deck-overview-index {
    width: 3rem;
    color: #666;
}
.overview-table .deck-overview-deck {
    max-width: 24vw;
}
.overview-table .deck-overview-clock {
    width: 5rem;
    text-align: center;
    font-weight: 600;
}
.overview-table .deck-overview-clock-empty {
    color: #b0bec5;
    font-weight: 400;
}
.match-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
}
.match-status-image {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.match-status-empty {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px dashed #b0bec5;
}
.overview-table .deck-group-header th {
    position: sticky;
    top: var(--overview-table-head-offset, 0px);
    z-index: 2;
    background: #ffffff;
    box-shadow: inset 0 -1px 0 #e0e0e0, 0 2px 8px rgba(0,0,0,0.06);
    padding: 12px 16px;
}
.deck-group-header-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 50vw;
    position: relative;
}
.deck-group-header-p1 {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 0.7em;
    color: #666;
}
@media (max-width: 1000px) {
    .overview-table-modal {
        width: 98vw;
        min-width: 98vw;
        padding: 0px 2vw;
    }
    .overview-table th, .overview-table td {
        padding: 6px 4px;
        font-size: 0.95em;
    }
    .overview-table th:nth-child(4),
    .overview-table td:nth-child(4) {
        display: none;
    }
    .overview-table .deck-group-header th {
        column-span: 3;
    }
}

/* Thread Creation Modal Styles */
.thread-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.45);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thread-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    max-width: 40em;
    width: 90vw;
    position: relative;
}

.thread-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    gap: 8px;
}

.thread-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4rem;
    flex: 1;
}

/* Shared styles for copy buttons in thread modal */
.copy-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #5865F2;
    padding: 4px 8px;
}

.copy-btn-icon:hover {
    color: #2c3e50;
}

.copy-title-btn {
    margin-right: 8px;
}

.thread-modal-content {
    padding: 24px;
}

.close-thread-modal:hover {
    color: #2c3e50;
}

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

/* Fullscreen analysis mode */
.fullscreen-analysis {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f7fa;
    z-index: 1000;
    padding: 0;
    overflow: visible;
}

/* Enable scrolling on mobile */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        min-height: 100vh;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        padding-bottom: env(safe-area-inset-bottom, 20px); /* Standard bottom padding for mobile browsers */
    }
    
    .container {
        overflow-y: visible;
        position: relative;
        min-height: 100vh;
    }
    
    .fullscreen-analysis {
        overflow-y: visible;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        min-height: 100vh;
        padding: 0;
    }
    
    /* Ensure body doesn't interfere with scrolling */
    body.fullscreen-mode {
        overflow-y: auto;
        position: absolute;
        width: 100%;
        height: auto;
        min-height: 100vh;
    }
    
    /* Improve touch scrolling and prevent bounce on iOS */
    .fullscreen-analysis .guru-analysis-interface {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: env(safe-area-inset-bottom, 40px); /* Add safe area padding */
    }
}

.fullscreen-analysis .guru-analysis-interface {
    display: flex;
    flex-direction: row;
    height: 100vh;
    gap: 0;
}

.fullscreen-analysis .match-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: white;
    border-radius: 0;
    box-shadow: none;
    border: none;
    padding: 10px;
    overflow-x: visible;
    position: relative;
}

.fullscreen-analysis .content-sidebar {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    padding: 10px;
    height: 100vh;
}

.fullscreen-analysis .editor-header {
    background: white;
    padding: 10px;
    margin: 0;
    border-top: none;
    border-radius: 0;
    box-shadow: none;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
    order: 3;
    margin-top: auto;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 20px)); /* Standard bottom padding for mobile browsers */
}

/* Multi-sheet layout */
.multi-sheet-container {
    max-width: 100%;
}

.sheet-title {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
}

.guru-summary {
    background-color: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: center;
    color: #0c5460;
}

.sheet-section {
    margin-bottom: 40px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: white;
}

.sheet-section-title {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.4rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.sheet-info {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-style: italic;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

/* Inline spinner for buttons */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff40;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 6px;
}

/* Simple app loading section under header */
.app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 8px;
    border: 2px dashed #ddd;
    color: #666;
}

.empty-state h3 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.empty-state ul {
    text-align: left;
    max-width: 500px;
    margin: 15px auto;
    padding-left: 20px;
}

.empty-state li {
    margin-bottom: 8px;
}

/* Guru Analysis Interface */
.guru-analysis-interface {
    width: 100%;
    margin: 0;
    padding: 0;
}

.match-details .player-deck {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 0;
}

.navigation-controls {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none; /* allow underlying elements to be clickable except buttons */
    z-index: 2;
    padding: 0 0.5rem;
}

.navigation-controls .nav-arrow-btn {
    pointer-events: auto; /* make buttons clickable */
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-size: 1.6rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: background 0.2s;
    font-weight: bold;
    color: #495057;
    cursor: pointer;
    line-height: 1;
}

.navigation-controls .nav-arrow-btn:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #343a40;
    transform: scale(1.05);
}

.navigation-controls .nav-arrow-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.navigation-controls .nav-arrow-btn:disabled {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #ced4da;
    cursor: not-allowed;
    opacity: 0.6;
}

.middle-controls {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: flex-end; /* align controls to the right */
    align-items: center;
    pointer-events: none; /* allow underlying elements to be clickable except buttons */
    z-index: 2;
    padding: 0 0.5rem;
}

.middle-controls .mirror-match-btn {
    pointer-events: auto;
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-size: 1.6rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.2s;
    font-weight: bold;
    color: #495057;
    cursor: pointer;
    line-height: 1;
    position: absolute;
    top: 50%; /* vertically center relative to controls */
    right: 1rem; /* flush to the right */
    white-space: nowrap;
    padding: 0 0.3rem;
}

/* Stretch button horizontally when it contains an outcome letter */
.middle-controls .mirror-match-btn.has-outcome {
    width: auto;
    min-width: 2.5rem;
    border-radius: 2rem;
    padding: 0 0.6rem;
    gap: 0.2rem; /* Add spacing between arrow and letter */
}

/* Style the outcome letter specifically */
.middle-controls .mirror-match-btn.has-outcome::after {
    content: attr(data-outcome);
    font-size: 1rem;
    font-weight: bold;
    color: inherit;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

.middle-controls .mirror-match-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #343a40;
}

.middle-controls .mirror-match-btn:active {
    transform: scale(0.95);
}

/* Mirror match button with inverse error styling */
.middle-controls .mirror-match-btn.inverse-error {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.player-deck h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.3rem;
    text-align: center;
}

/* Scoring section - now just shows current score */
.scoring-section {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 0;
    border: 1px solid #e9ecef;
    box-shadow: none;
    flex-shrink: 0;
    order: 1;
    position: relative;
}

.current-scoring {
    text-align: center;
    padding: 0;
    background: transparent;
    border: none;
    margin: 0;
    flex: 0 0 auto;
}

.current-scoring h3 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.scoring-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #495057;
}

/* Warning state for discrepancy */
.scoring-value.discrepancy {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.discrepancy-content {
    color: #e74c3c;
    background: #ffeaa7;
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid #fdcb6e;
}

.discrepancy-header,
.outcome-header {
    font-weight: bold;
    margin-bottom: 0;
    font-size: 1.1em;
}

/* Analysis content with current + other gurus */
.analysis-content {
    color: #2c3e50;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid #dee2e6;
    margin-bottom: 8px;
}

.current-analysis {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid;
    font-weight: 600;
    min-height: 60px;
    text-align: center;
}

.current-analysis.win {
    background: #28a745;
    color: white;
    border-color: #155724;
}

.current-analysis.tie {
    background: #ffc107;
    color: #212529;
    border-color: #856404;
}

.current-analysis.loss {
    background: #dc3545;
    color: white;
    border-color: #721c24;
}

.current-analysis.other {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.other-analyses {
    display: flex;
    flex-direction: row;
    gap: 8px;
    font-size: 0.9em;
    flex-wrap: wrap;
}

.other-analysis {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid;
    font-weight: 600;
    min-height: 60px;
    flex: 1;
    min-width: 120px;
    text-align: center;
}

.other-analysis.win {
    background: #28a745;
    color: white;
    border-color: #155724;
}

.other-analysis.tie {
    background: #ffc107;
    color: #212529;
    border-color: #856404;
}

.other-analysis.loss {
    background: #dc3545;
    color: white;
    border-color: #721c24;
}

.other-analysis.other {
    background: #6c757d;
    color: white;
    border-color: #495057;
}

.guru-name {
    font-weight: 700;
    font-size: 0.95em;
    margin-bottom: 4px;
}

.analysis-value {
    font-weight: 500;
    font-size: 0.85em;
    line-height: 1.2;
}

/* Mobile responsive - stack vertically on small screens */
@media (max-width: 480px) {
    .other-analyses {
        flex-direction: column;
    }
    
    .other-analysis {
        min-width: auto;
    }
}

/* New list-style analysis display */
.analysis-list {
    padding: 8px 0;
    position: relative; /* Enable absolute positioning for children */
}

/* Discord icon in top-right corner */
.discord-icon-link,
.discord-icon-button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 10;
}

.discord-icon-link:hover,
.discord-icon-button:hover {
    transform: scale(1.1);
}

.discord-icon-link img,
.discord-icon-button img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Add "+" symbol to Black Discord icon (create new thread) */
.discord-icon-button::after {
    content: '+';
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: white;
    color: #000;
    font-size: 12px;
    font-weight: bold;
    line-height: 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.guru-analyses-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95em;
}

.guru-analysis-item {
    display: flex;
    align-items: center;
    padding: 4px 0;
    margin: 2px 0;
}

.guru-analysis-label {
    font-weight: 700;
    margin-right: 8px;
    min-width: 45px;
    color: #495057;
}

.guru-analysis-label.guru-signature {
    text-decoration: underline dotted;
    text-decoration-color: #6c757d;
    cursor: help;
    position: relative;
}

/* Tooltip for guru signatures - hidden by default */
.guru-signature-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 5px;
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.2s ease-in, transform 0.2s ease-in;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Show tooltip on hover */
.guru-analysis-label.guru-signature:hover .guru-signature-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Show tooltip on tap (mobile) */
.guru-analysis-label.guru-signature:active .guru-signature-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.analysis-result {
    font-weight: 600;
}

.analysis-result.win {
    color: #28a745;
}

.analysis-result.tie {
    color: #ffc107;
}

.analysis-result.loss {
    color: #dc3545;
}

.analysis-result.other {
    color: #6c757d;
}

.scoring-buttons {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.deck-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap-reverse;
    gap: 10px;
    justify-content: center;
}

.card-images {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center;
    flex-wrap: nowrap;
    align-items: flex-start;
    flex-shrink: 0;
    overflow: visible;
}

.deck-info {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    padding: 8px;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.3;
    flex: 1;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex-shrink: 0;
    min-width: 200px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.deck-clock {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50;
    display: block;
    margin-bottom: 8px;
}

.deck-field-label {
    font-weight: bold;
    color: #2c3e50;
}

.deck-separator {
    border: none;
    border-top: 1px solid #78a9d1;
    margin: 8px 0;
    opacity: 0.6;
}

.edit-deck-info-btn {
    background: none;
    border: none;
    color: #80b3dd;
    cursor: pointer;
}

.edit-deck-info-btn:hover {
    color: #1a3d5d;
}

/* The whole field is the edit target; the pencil is only a hint. */
.deck-field {
    cursor: pointer;
}

.deck-field:hover {
    background: rgba(144, 202, 249, 0.25);
}

.card-slot {
    width: auto;
    height: 100%;
    max-height: min(400px, calc(50vh - 80px));
    max-width: 33%;
    aspect-ratio: 488 / 680;
    border-radius: 8px;
    overflow: visible;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.card-link {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-link:hover {
    transform: scale(1.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10;
    position: relative;
}

/* Set origins for hover effects to try to keep cards in the decks area */
#player1-cards .card-link:hover {
    transform-origin: center;
}

#player1-cards .card-slot:first-child .card-link:hover {
    transform-origin: left;
}

#player1-cards .card-slot:last-child .card-link:hover {
    transform-origin: right;
}

#player2-cards .card-link:hover {
    transform-origin: center bottom;
}
#player2-cards .card-slot:first-child .card-link:hover {
    transform-origin: left bottom;
}

#player2-cards .card-slot:last-child .card-link:hover {
    transform-origin: right bottom;
}

.card-link:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.card-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.card-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.card-loading {
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
}

.card-error {
    color: #dc3545;
    font-size: 0.8rem;
    text-align: center;
    padding: 10px;
    line-height: 1.4;
}

/* Deck clock, notes, and additional styles are defined above in the player-deck section */

.current-analysis h3 {
    color: #0c5460;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.scoring-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: #0c5460;
}

.scoring-btn {
    flex: 1;
    min-width: 80px;
    max-width: 120px;
    padding: 12px 8px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Highlighted states for current analysis */
.scoring-btn.current-analysis {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
    pointer-events: none;
    cursor: default;
}

.win-btn {
    background: #28a745;
    color: white;
}

.win-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.win-btn.current-analysis {
    border-color: #155724;
    background: #218838;
}

.win-btn.current-analysis:hover {
    transform: scale(1.05);
    background: #218838;
}

.tie-btn {
    background: #ffc107;
    color: #212529;
}

.tie-btn:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.tie-btn.current-analysis {
    border-color: #856404;
    background: #e0a800;
}

.tie-btn.current-analysis:hover {
    transform: scale(1.05);
    background: #e0a800;
}

.loss-btn {
    background: #dc3545;
    color: white;
}

.loss-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.loss-btn.current-analysis {
    border-color: #721c24;
    background: #c82333;
}

.loss-btn.current-analysis:hover {
    transform: scale(1.05);
    background: #c82333;
}

.btn-label {
    font-size: 1rem;
}

.btn-value {
    font-size: 0.8rem;
    opacity: 0.8;
}

.navigation-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
    background: white;
    border-radius: 0;
    border: 1px solid #e9ecef;
    box-shadow: none;
    padding: 10px;
    flex: none;
    justify-content: center;
    order: 2;
    margin-top: auto;
    margin-bottom: auto;
}

.navigation-buttons .scoring-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.navigation-buttons button {
    min-width: 80px;
    flex-shrink: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .title-with-logo {
        justify-content: center;
    }
    
    .header-logo {
        height: 48px;
    }
    
    .header-title h1 {
        text-align: center;
        font-size: 2rem;
    }
    
    .header-title p {
        text-align: center;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group input {
        min-width: auto;
    }
    
    .editor-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .header-left {
        text-align: center;
    }
    
    .analysis-progress {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .editor-controls {
        justify-content: center;
    }

    .log-download-btn {
        margin-left: 0;
    }
    
    /* Mobile - revert to vertical layout */
    .fullscreen-analysis .guru-analysis-interface {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
        padding-bottom: env(safe-area-inset-bottom, 0); /* Add safe area padding */
    }
    
    .fullscreen-analysis .content-sidebar {
    flex: none;
        order: 2;
        padding: 10px;
        height: auto;
        overflow-y: visible;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 20px)); /* Standard bottom padding for mobile browsers */
    }
    
    .fullscreen-analysis .match-details {
        flex: none;
        order: 1;
        height: auto;
        min-height: 0;
        margin-bottom: 10px;
        padding: 10px;
        overflow-y: visible;
    }
    
    /* Guru Analysis Responsive */
    .guru-analysis-interface {
        padding: 0;
    }
    
    .match-details .player-deck {
        flex: none;
        justify-content: flex-start;
    }
    
    /* Mobile navigation controls */
    .navigation-controls {
        padding: 0 10px;
        height: 50px;
    }
    
    .nav-arrow-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .player-info {
        flex-direction: column;
        gap: 15px;
    }

    .scoring-btn {
        max-width: none;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        min-width: auto;
    }
    
    .scoring-btn.current-analysis {
        transform: scale(1.02);
    }
    
    .navigation-buttons {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .navigation-buttons .scoring-buttons {
        order: 1;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .navigation-buttons button {
        min-width: 80px;
    }
    
    .navigation-buttons > button {
        order: 0;
        width: 100%;
        max-width: 200px;
    }
    
    .navigation-buttons > button:last-child {
        order: 2;
    }

    .card-images {
        gap: 10px;
        max-height: none; /* Remove height restriction to allow deck info below */
        flex-wrap: wrap; /* Allow wrapping on mobile */
    }

    /* Mobile-specific deck info positioning */
    .deck-info {
        min-width: auto;
        width: 100%; /* Full width on mobile */
        margin-top: 10px;
        max-width: 100%;
        flex-basis: 100%; /* Take full row */
        padding: 6px;
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .deck-info .deck-clock {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }

    .deck-info .deck-separator {
        margin: 4px 0;
    }

    .card-slot {
        min-width: 100px;
        max-width: min(140px, calc((100vw - 60px) / 3));
        height: 100%;
        max-height: min(196px, calc(40vh - 60px));
        aspect-ratio: 488 / 680;
    }

    .card-link:hover {
        transform: none; /* Disable hover transform on mobile for better touch experience */
    }

    .scoring-section {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .current-scoring {
        text-align: center;
    }

    .scoring-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .scoring-btn {
        min-width: 80px;
        flex: 1;
        max-width: 120px;
    }
    
    .scoring-btn.current-analysis {
        transform: scale(1.02);
    }
}

.full-screen {
    margin: 0 auto;
    text-align: center;
    padding: 0px 20px;
    max-height: 100vh;
}

/* Deck Notes gate (one deck at a time, mirrors the analysis shell) */
.deck-notes-screen .deck-notes-interface {
    display: flex;
    flex-direction: row;
    height: 100vh;
    gap: 0;
    width: 100%;
}

.deck-notes-screen .match-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: white;
    padding: 10px;
    overflow-x: visible;
    position: relative;
}

.deck-notes-screen .content-sidebar {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    padding: 10px;
    height: 100vh;
}

.deck-notes-screen .editor-header {
    background: white;
    padding: 10px;
    margin: 0;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
    order: 3;
    margin-top: auto;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 20px));
}

.deck-notes-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.deck-notes-controls .navigation-controls {
    position: static;
    width: 100%;
}

.deck-notes-progress {
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
    cursor: pointer;
}

#deck-notes-progress:hover,
#deck-notes-progress:focus {
    background: #e3f2fd;
    border-color: #90caf9;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.08);
    outline: none;
}

.deck-notes-clocks {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

#deck-notes-next-empty-btn,
#deck-notes-start-btn,
#deck-notes-back-btn {
    width: 100%;
    max-width: 260px;
}

#deck-notes-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.deck-notes-deck {
    justify-content: flex-start;
    padding-top: 10px;
}

/* Prominent deck-info variant: larger, full-width edit affordances */
.deck-info.prominent {
    font-size: 1rem;
    line-height: 1.5;
    padding: 14px;
}

.deck-info.prominent .deck-clock {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

/* Visible frame around each clickable field, so the whole area reads as
   an edit affordance rather than just the small pencil. */
.deck-info.prominent .deck-field {
    display: block;
    border: 2px dashed #90caf9;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #f5faff;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.deck-info.prominent .deck-field:hover,
.deck-info.prominent .deck-field:focus-within {
    border-color: #2196f3;
    background: #e3f2fd;
}

.deck-info.prominent .deck-field .edit-deck-info-btn {
    float: right;
    font-size: 1.1rem;
}

.deck-info.prominent .notes-value {
    display: block;
}

.deck-info.prominent .deck-clock .notes-value {
    display: inline;
}

.deck-info.prominent .deck-info-edit-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 6px 8px;
}

/* Clock signature tooltip (shared with the analysis guru-signature tooltip) */
.deck-clock-signed {
    position: relative;
    text-decoration: underline dotted;
    text-decoration-color: #6c757d;
    cursor: help;
}

.deck-clock-signed:hover .guru-signature-tooltip,
.deck-clock-signed:active .guru-signature-tooltip {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .deck-notes-screen .deck-notes-interface {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
    }

    .deck-notes-screen .content-sidebar {
        flex: none;
        order: 2;
        height: auto;
        padding: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 20px));
    }

    .deck-notes-screen .match-details {
        flex: none;
        order: 1;
        height: auto;
        min-height: 0;
        margin-bottom: 10px;
    }
}


/* Color Selection Screen */
.color-selection-screen h3 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 16px;
}

.color-selection-screen p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.6;
}

.color-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.color-option:hover {
    border-color: #007bff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.color-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.color-circle.red {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.color-circle.blue {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.color-circle.green {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.color-info {
    flex: 1;
    text-align: left;
}

.color-info h4 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.color-info p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.select-color-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.select-color-btn:hover {
    background: #0056b3;
}

.color-selection-note {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

/* Mobile responsiveness for color selection */
@media (max-width: 768px) {
    .color-option {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .color-info {
        text-align: center;
    }
    
    .select-color-btn {
        width: 100%;
    }
}

/* Footer */
.app-footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.875rem;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.app-version {
    color: #888;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.deployment-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.deployment-switch:empty {
    display: none;
}

.deployment-switch-note {
    color: #888;
    font-size: 0.8rem;
}

.deployment-switch-btn {
    background: none;
    border: 1px solid #3498db;
    color: #3498db;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

.deployment-switch-btn:hover {
    background: #3498db;
    color: #fff;
}

