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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background-color: #ffffff;
    color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 700px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 48px;
    font-weight: 300;
    letter-spacing: 8px;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    color: #666;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.round-indicator {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.game-area {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#gameCanvas {
    border: 1px solid #000;
    cursor: crosshair;
    background-color: #ffffff;
}

#gameCanvas.played {
    cursor: not-allowed;
}

.confirm-btn {
    display: block;
    margin: 20px auto;
    padding: 14px 40px;
    background-color: #D2691E;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.confirm-btn:hover {
    background-color: #B8551A;
}

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

.confirm-btn.hidden {
    display: none;
}

.result {
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid #000;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    margin: 30px auto;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

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

.result.hidden {
    display: none;
}

.result h2 {
    font-size: 48px;
    font-weight: 300;
    margin-bottom: 20px;
    color: #D2691E;
}

.result p {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

/* Round Breakdown */
.round-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 25px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.round-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #D2691E;
}

.round-label {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    flex: 1;
}

.round-score {
    font-size: 24px;
    font-weight: 700;
    margin: 0 15px;
}

.round-distance {
    font-size: 12px;
    color: #666;
    flex: 1;
    text-align: right;
}

/* Round Selector */
.round-selector {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.round-selector.hidden {
    display: none;
}

.selector-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.round-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.round-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.round-btn:hover {
    border-color: #D2691E;
    background: #fff5f0;
}

.round-btn.active {
    border-color: #D2691E;
    background: #D2691E;
    color: white;
}

.share-btn {
    margin-top: 20px;
    padding: 12px 30px;
    background-color: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: background-color 0.2s;
}

.share-btn:hover {
    background-color: #333;
}

.secondary-stats {
    margin: 15px 0;
}

.secondary-stats p {
    font-size: 14px;
    margin: 6px 0;
    color: #666;
}

.info-section {
    text-align: center;
    font-size: 14px;
    color: #666;
}

#dateDisplay {
    margin-bottom: 10px;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 140px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover,
.action-btn:focus-visible {
  background-color: #000;
  color: #fff;
  outline: none;
}

.action-btn svg {
  display: inline-block;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #fff;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-width: 420px;
    width: 100%;
    position: relative;
}

.modal-content h2 {
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 24px;
    letter-spacing: 1px;
    color: #000;
}

.instructions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(210, 105, 30, 0.08) 0%, rgba(210, 105, 30, 0.04) 100%);
    border-radius: 6px;
    border-left: 3px solid #D2691E;
    transition: all 0.2s ease;
}

.instruction-item:hover {
    background: linear-gradient(135deg, rgba(210, 105, 30, 0.15) 0%, rgba(210, 105, 30, 0.08) 100%);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(210, 105, 30, 0.15);
}

.instruction-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background-color: #D2691E;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.instruction-item p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    padding-top: 3px;
}

.close {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    color: #666;
    transition: color 0.2s ease;
}

.close:hover {
    color: #D2691E;
}

/* Community Modal */
.community-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.community-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(210, 105, 30, 0.08) 0%, rgba(210, 105, 30, 0.04) 100%);
    border-radius: 6px;
    border-left: 3px solid #D2691E;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.community-link:hover {
    background: linear-gradient(135deg, rgba(210, 105, 30, 0.15) 0%, rgba(210, 105, 30, 0.08) 100%);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(210, 105, 30, 0.15);
}

.community-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background-color: #D2691E;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.community-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.community-title {
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

/* Histogram styles */
.histogram {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px dashed #ddd;
}

.histogram-bar {
  width: 32px;
  background-color: #D2691E;
  border: 1px solid #a95616;
  transition: height 0.3s ease;
}

.histogram-bar.zero {
  background-color: #f0f0f0;
  border-color: #ddd;
}

.histogram-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.histogram-label {
  font-size: 10px;
  color: #666;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 650px) {
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    h1 {
        font-size: 36px;
    }
    
    .round-result {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .round-distance {
        text-align: center;
    }
    
    .histogram-bar {
        width: 24px;
    }
}