/* Game styles for the Center Spread player (play.html). */

/* ── Connections ── */

  .conn-game { margin: 18px 0 8px; }

  .conn-solved-rows { margin: 0 0 10px; }
  .conn-solved-row {
    margin: 6px 0;
    padding: 12px 14px;
    border-radius: 6px;
    text-align: center;
  }
  .conn-solved-row.cat-1 { background: #fff4d2; }
  .conn-solved-row.cat-2 { background: #d8efd8; }
  .conn-solved-row.cat-3 { background: #d8e6f4; }
  .conn-solved-row.cat-4 { background: #e6d8f4; }
  .conn-solved-row.is-revealed { opacity: 0.9; outline: 1px dashed rgba(0,0,0,0.15); }
  .conn-solved-name {
    font-family: "Old Standard TT", Georgia, serif;
    font-weight: bold;
    font-size: 15px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 2px;
    color: #1a1a1a;
  }
  .conn-solved-words {
    font-family: Georgia, serif;
    font-size: 14px;
    color: #1a1a1a;
  }

  .conn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 14px 0;
  }
  .conn-tile {
    background: #f7f3e8;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px 6px;
    min-height: 56px;
    text-align: center;
    font-family: Georgia, serif;
    font-size: 14px;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    transition: background 120ms ease, color 120ms ease, transform 80ms ease;
  }
  .conn-tile:hover:not(:disabled) { background: #ede5d3; }
  .conn-tile:disabled { cursor: default; opacity: 0.6; }
  .conn-tile.is-selected {
    background: #5a5a5a;
    color: #fff;
    border-color: #444;
  }
  .conn-tile.is-shake { animation: conn-shake 0.45s ease; }
  @keyframes conn-shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-4px); }
    40%      { transform: translateX(4px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(3px); }
  }
  @media (max-width: 540px) {
    .conn-grid { gap: 6px; }
    .conn-tile { padding: 14px 4px; font-size: 12px; min-height: 50px; }
  }

  .conn-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 12px 0 4px;
    font-family: Georgia, serif;
    font-size: 13px;
    flex-wrap: wrap;
  }
  .conn-mistakes-label { color: #555; }
  .conn-hearts { display: inline-block; margin-left: 6px; }
  .conn-heart {
    display: inline-block;
    margin: 0 2px;
    color: #c44;
    font-size: 14px;
    transition: opacity 220ms ease, transform 220ms ease;
  }
  .conn-heart[data-active="false"] { opacity: 0.18; transform: scale(0.85); }
  .conn-message {
    font-style: italic;
    color: #555;
    min-height: 1.2em;
  }
  .conn-message[data-kind="warn"] { color: #b78600; font-style: normal; }
  .conn-message[data-kind="win"]  { color: #2e7d32; font-style: normal; font-weight: bold; }
  .conn-message[data-kind="lose"] { color: #c44; font-style: normal; font-weight: bold; }

  .conn-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 14px 0 6px;
    flex-wrap: wrap;
  }
  .conn-btn {
    font-family: Georgia, serif;
    font-size: 14px;
    padding: 8px 20px;
    border-radius: 999px;
    cursor: pointer;
    border: 1px solid #1a1a1a;
    background: transparent;
    color: #1a1a1a;
    transition: background 120ms ease, color 120ms ease, opacity 120ms ease;
  }
  .conn-btn:hover:not(:disabled) { background: #1a1a1a; color: #fff; }
  .conn-btn:disabled { opacity: 0.3; cursor: not-allowed; }
  .conn-btn-primary { background: #1a1a1a; color: #fff; }
  .conn-btn-primary:hover:not(:disabled) { background: #000; }

  .conn-secondary-link {
    text-align: center;
    margin: 22px 0 0;
    font-family: Georgia, serif;
    font-size: 13px;
  }
  .conn-secondary-link a { color: #555; }

/* ── Word Scramble ── */

  .ws-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    flex-wrap: wrap;
  }
  .ws-status {
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 14px;
    color: #555;
  }
  .ws-reveal-all-btn {
    background: transparent;
    border: 1px solid var(--accent, #2e7d32);
    color: var(--accent, #2e7d32);
    font-family: Georgia, serif;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
  }
  .ws-reveal-all-btn:hover { background: var(--accent, #2e7d32); color: #fff; }

  .ws-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .ws-row {
    display: grid;
    grid-template-columns: 30px 1.2fr 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e0d6c4;
  }
  .ws-row:last-child { border-bottom: none; }
  .ws-num {
    font-family: "Old Standard TT", Georgia, serif;
    color: var(--accent, #2e7d32);
    font-size: 13px;
    letter-spacing: 1px;
  }
  .ws-scramble {
    font-family: "Old Standard TT", Georgia, serif;
    font-size: 17px;
    letter-spacing: 1.5px;
    color: #1a1a1a;
  }
  .ws-input {
    font-family: Georgia, serif;
    font-size: 14px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    text-transform: uppercase;
    color: #1a1a1a;
    width: 100%;
    min-width: 0;
  }
  .ws-input:focus { outline: none; border-color: var(--accent, #2e7d32); }
  .ws-input.is-correct { background: #e7f4e7; border-color: var(--accent, #2e7d32); color: var(--accent, #2e7d32); font-weight: bold; }
  .ws-input.is-wrong { background: #fbeaea; border-color: #c44; }
  .ws-input.is-revealed { background: #f7f3e8; color: #888; font-style: italic; }
  .ws-show {
    background: transparent;
    border: 1px solid #ccc;
    color: #666;
    font-family: Georgia, serif;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
  }
  .ws-show:hover { border-color: #888; color: #1a1a1a; }
  .ws-status-icon {
    font-family: "Old Standard TT", Georgia, serif;
    color: var(--accent, #2e7d32);
    font-size: 18px;
    width: 16px;
    text-align: center;
  }
  @media (max-width: 600px) {
    .ws-row {
      grid-template-columns: 26px 1fr;
      grid-template-rows: auto auto;
      gap: 6px;
    }
    .ws-scramble { grid-column: 2; }
    .ws-input { grid-column: 1 / -1; grid-row: 2; }
    .ws-show, .ws-status-icon { grid-row: 2; }
    .ws-show { grid-column: -2; }
    .ws-status-icon { grid-column: -1; }
  }

/* ── Custom (pasted-code) games ── */
.cs-code-frame { display: block; width: 100%; border: 1px solid var(--rule, #ddd); border-radius: 6px; background: #fff; }
.cs-error { color: #b8002a; font-family: Georgia, serif; }

/* ── Ported puzzle extras (the base .cw-*, .sb-* and .ws-cell styles live in centerspread.css) ── */
.cw-grid-wrap { position: relative; }
.cw-input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; pointer-events: none; }
.sb-layout:focus { outline: none; }
.sb-layout:focus-visible { outline: 2px solid var(--accent, #2e7d32); outline-offset: 4px; border-radius: 6px; }
.btn-toggle-solution--ghost { background: #fff; color: var(--accent, #2e7d32); border: 1px solid var(--accent, #2e7d32); }
