:root {
  --color-primary: #1a1a1a;
  --color-text: #2c3e50;
  --color-light: #666;
  --color-border: #e0e0e0;
  --color-bg: #f8f9fa;
  --color-white: #ffffff;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  --border-radius: 8px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

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

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.status-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.status {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

.turn-indicator {
    display: flex;
    gap: 12px;
    align-items: center;
}

.coin-indicator {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    cursor: default;
    position: relative;
}


.about-content {
    max-width: 650px;
    margin: 40px auto;
    text-align: center;
}

.about-content p {
    font-size: 18px;
    line-height: 1.8;
    color: #444;
}
ul, ol {
            margin-bottom: 1em;
            padding-left: 2em;
        }

.coin-indicator.active {
    background: white;
}

.coin-indicator.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: black;
    border-radius: 2px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 28px;
        opacity: 1;
    }
}

.coin-display {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ccc;
}


.coin-indicator.active .coin-display {
    border-width: 2px;
}

.coin-display.red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #c92a2a);
    border-color: #a61e1e;
}

.coin-display.yellow {
    background: radial-gradient(circle at 30% 30%, #ffd93d, #f5b800);
    border-color: #c99200;
}

.controls button {
    padding: 10px 20px;
    border: 2px solid #333;
    background: white;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 25px;
}

.controls button:hover {
    background: #333;
    color: white;
    transform: translateY(-2px);
}

.board {
    background: white;
    border: 3px solid black;
    border-radius: 12px;
    padding: 20px;
    margin: 0 auto;
    width: fit-content;
    position: relative;
}

.row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.row:last-child {
    margin-bottom: 0;
}

.cell {
    width: 100px;
    height: 100px;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.cell:hover:not(.occupied) {
    border-color: #999;
    background: #f0f0f0;
    transform: scale(1.05);
}

.cell.player1 {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #c92a2a);
    border-color: #a61e1e;
}

.cell.player2 {
    background: radial-gradient(circle at 30% 30%, #ffd93d, #f5b800);
    border-color: #c99200;
}

.cell.last-move {
    border: 3px dashed #ffffff;
    animation: highlight 0.5s ease-in-out;
}

@keyframes highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.cell.winner {
    animation: pulse 0.8s ease-in-out infinite;
}

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

.loading {
    text-align: center;
    padding: 15px;
    color: #666;
    font-size: 0.9rem;
}

/* Game Over Overlay */
.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
    pointer-events: none;
}

.game-over-overlay.show {
    display: flex;
    pointer-events: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-over-message {
    background: white;
    padding: 30px 50px;
    border-radius: 15px;
    text-align: center;
    animation: slideDown 0.4s ease-out;
}

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

.game-over-message h2 {
    font-size: 32px;
    margin-bottom: 12px;
    font-weight: 700;
    color: black;
}

.game-over-message p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.game-over-message button {
    padding: 10px 30px;
    font-size: 14px;
    font-weight: 600;
    background: #333;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
}

.game-over-message button:hover {
    background: #555;
    transform: scale(1.05);
}

.back-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.back-link a {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.back-link a:hover {
    opacity: 0.6;
}

@media (max-width: 768px) {
    .container {
        flex-direction: row;
        padding: 25px;
    }

    .cell {
        width: 50px;
        height: 50px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .board {
        padding: 15px;
    }

    .row {
        gap: 8px;
        margin-bottom: 8px;
    }

    .game-over-message {
        padding: 40px 50px;
    }

    .game-over-message h2 {
        font-size: 36px;
    }

    .turn-indicator {
        gap: 8px;
    }

    .coin-indicator {
        width: 32px;
        height: 32px;
    }

    .coin-display {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .cell {
        width: 42px;
        height: 42px;
    }

    .board {
        padding: 12px;
    }

    .row {
        gap: 6px;
        margin-bottom: 6px;
    }

    .game-over-message {
        padding: 30px 40px;
    }

    .game-over-message h2 {
        font-size: 28px;
    }

    .game-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

.references-section {
    margin-top: 32px;
}

.references-title,
.references {
    text-align: left;
}


.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 30px;
}

/* Navigation */
.nav {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 5px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 5px;
}

.nav__logo {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav__options {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* User Section in Nav */
.user-section-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-info span {
  font-size: 14px;
  color: var(--color-primary);
}

.gomoku-board .cell.player1,
.gomoku-board .stone.player1,
.gomoku-board .piece.player1 {
  background: radial-gradient(circle at 0% 0%, #444, #0b0b0b);
  border-color: #000;
}

.gomoku-board .cell.player2,
.gomoku-board .stone.player2,
.gomoku-board .piece.player2 {
  background: radial-gradient(circle at 0% 0%, #f0f0f0, #9a9a9a);
  border-color: #666;
}

.gomoku-page .coin-display.red {
  background: radial-gradient(circle at 30% 30%, #444, #0b0b0b);
  border-color: #000;
}

.gomoku-page .coin-display.yellow {
  background: radial-gradient(circle at 30% 30%, #f0f0f0, #9a9a9a);
  border-color: #666;
}

/* ============================
   Gomoku Go-board skin (15x15)
   Lines + star points like screenshot
   ============================ */

.gomoku-go-board{
  /* tweak these if you want bigger/smaller */
  --n: 15;
  --cell: 30px;          /* spacing between intersections */
  --line: 2px;           /* grid line thickness */
  --pad: 26px;           /* wood margin around grid */
  --wood: #d8b15a;       /* board color */

  position: relative;
  background: var(--wood);
  border-radius: 6px;
  padding: var(--pad);
  width: fit-content;
  margin: 0 auto;
  box-shadow: 0 10px 24px rgba(0,0,0,0.15);
}

/* Override the global .board styling just for Gomoku Go-board */
.gomoku-go-board.board{
  border: none;
}

/* IMPORTANT: your existing .row/.cell styles have gaps, white backgrounds and borders,
   which hide any grid drawn behind them. These overrides make the grid visible. */
.gomoku-go-board .row{
  display: flex;
  gap: 0;
  margin: 0;
  height: var(--cell);
}

.gomoku-go-board .cell{
  width: var(--cell);
  height: var(--cell);
  border: none;
  background: transparent;
  border-radius: 50%;
  position: relative;
  z-index: 2; /* stones above the grid */
}

.gomoku-go-board::before{
  content: "";
  position: absolute;
  left: calc(var(--pad) + (var(--cell) / 2));
  top:  calc(var(--pad) + (var(--cell) / 2));
  width:  calc((var(--n) - 1) * var(--cell));
  height: calc((var(--n) - 1) * var(--cell));
  pointer-events: none;
  z-index: 1;

  outline: 3px solid #000;

  background-image:
    linear-gradient(to right, #000 var(--line), transparent var(--line)),
    linear-gradient(to bottom, #000 var(--line), transparent var(--line));
  background-size: var(--cell) var(--cell);
  background-position: 0 0, 0 0;
}

.gomoku-go-board::after{
  content: "";
  position: absolute;
  left: calc(var(--pad) + (var(--cell) / 2));
  top:  calc(var(--pad) + (var(--cell) / 2));
  width:  calc((var(--n) - 1) * var(--cell));
  height: calc((var(--n) - 1) * var(--cell));
  pointer-events: none;
  z-index: 1;

  background-repeat: no-repeat;
  background-size: 10px 10px;
  background-image:
    radial-gradient(circle, #000 0 4px, transparent 5px),
    radial-gradient(circle, #000 0 4px, transparent 5px),
    radial-gradient(circle, #000 0 4px, transparent 5px),
    radial-gradient(circle, #000 0 4px, transparent 5px),
    radial-gradient(circle, #000 0 4px, transparent 5px);

  background-position:
    calc(3 * var(--cell) - 5px)  calc(3 * var(--cell) - 5px),
    calc(11 * var(--cell) - 5px) calc(3 * var(--cell) - 5px),
    calc(7 * var(--cell) - 5px)  calc(7 * var(--cell) - 5px),
    calc(3 * var(--cell) - 5px)  calc(11 * var(--cell) - 5px),
    calc(11 * var(--cell) - 5px) calc(11 * var(--cell) - 5px);
}

/* Go stones (keep your existing player1/player2 mapping) */
.gomoku-go-board .cell.player1{
  background: radial-gradient(circle at 35% 35%, #444 0%, #111 65%, #000 100%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.55);
}

.gomoku-go-board .cell.player2{
  background: radial-gradient(circle at 35% 35%, #fff 0%, #ddd 65%, #bbb 100%);
  box-shadow: 0 3px 8px rgba(0,0,0,0.35);
}

/* Last move highlight (optional) */
.gomoku-go-board .cell.last-move{
  box-shadow: 0 0 0 3px #ffd700, 0 0 10px rgba(255,215,0,0.8);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background: #333;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  padding: 8px 16px;
  font-size: 13px;
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* Heading Section */
.heading {
  padding: 0px 0;
  background: var(--color-bg);
  text-align: center;
}

.heading__body {
  max-width: 800px;
  margin: 0 auto;
}

.heading__headline h1 {
  font-size: 42px;
  margin-bottom: 30px;
  line-height: 1.3;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}

.heading__content {
  font-size: 18px;
  color: var(--color-light);
  line-height: 1.8;
}

/* Search Section */
.search-section {
  padding: 40px 0;
}

.search-pane {
  max-width: 800px;
  margin: 0 auto;
}

.search-box {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  padding: 15px 20px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 16px;
  font-family: var(--font-sans);
  transition: var(--transition);
  min-width: 300px;
}

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

/* Results Section */
.results-section {
  background: var(--color-white);
  padding: 40px 0;
}

.results {
  display: grid;
  gap: 24px;
  margin-top: 40px;
}

/* Cards */
.post-card {
  background: var(--color-white);
  padding: 28px;
  border-radius: var(--border-radius);
  transition: var(--transition);
  border: 1px solid var(--color-border);
  margin-bottom: 0;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.post-date {
  font-size: 13px;
  color: var(--color-light);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-card h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 12px;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.post-card h3:hover {
  color: #333;
}

.post-card p {
  font-size: 15px;
  color: var(--color-light);
  line-height: 1.6;
  margin-bottom: 16px;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  background: #e0e7ff;
  color: #1a1a1a;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 8px;
  margin-bottom: 8px;
}

.similarity-badge {
  display: inline-block;
  padding: 6px 12px;
  background: #d1fae5;
  color: #059669;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 15px;
}

.date-badge {
  padding: 4px 10px;
  background: var(--color-bg);
  color: var(--color-light);
  border-radius: 12px;
  font-size: 12px;
  margin-right: 8px;
}

.card__actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.common-button {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 14px;
}

.common-button:hover {
  background: #333;
  transform: translateX(4px);
}

.common-button--secondary {
  background: var(--color-bg);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.common-button--secondary:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--color-white);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
}

.empty-state h3 {
  font-size: 24px;
  margin-bottom: 10px;
  color: var(--color-primary);
}

.empty-state p {
  color: var(--color-light);
  font-size: 16px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  border: 3px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

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

.loading p {
  color: var(--color-light);
}

/* Footer */
.footer {
  margin-top: 80px;
  padding-top: 30px;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer__content p {
  color: var(--color-light);
  font-size: 14px;
}

/* Tab Content Animation */

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    justify-content: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 8px;
}

.tab {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-light);
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    border-bottom: 2px solid transparent;
}

.tab:hover {
    color: var(--color-primary);
}

.tab.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

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

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 10px 10px;
  }

  .heading__headline h1 {
    font-size: 32px;
  }

  .nav__container {
    flex-direction: column;
    gap: 5px;
  }

  .nav__options {
    width: 100%;
    justify-content: center;
  }

  .search-box {
    flex-direction: column;
  }

  .search-input {
    width: 100%;
    min-width: auto;
  }

  .post-card {
    padding: 20px;
  }

  .post-card h3 {
    font-size: 18px;
  }
}



