/* Styles specific to Şeker Avı; artwork paths resolve from assets/. */
:root { --moss: #5c7a3d; --moss-dark: #43602a; --layout-gap: 2rem; --shell-shadow: 90, 70, 30; }


  h1 {
    font-size: 1.3rem;
    margin: 0 0 0.3rem;
    color: var(--accent-dark);
  }


  p.subtitle {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--muted);
  }


  .level-btn .level-dot {
    fill: rgba(255, 250, 240, 0.35);
    transition: fill 0.15s ease;
  }


  .level-btn[data-level="level0"] .level-dot:nth-of-type(1) {
    fill: #fffaf0;
  }


  .level-btn[data-level="level1"] .level-dot:nth-of-type(1),
  .level-btn[data-level="level1"] .level-dot:nth-of-type(2) {
    fill: #fffaf0;
  }


  .level-btn[data-level="level2"] .level-dot:nth-of-type(1),
  .level-btn[data-level="level2"] .level-dot:nth-of-type(2),
  .level-btn[data-level="level2"] .level-dot:nth-of-type(3) {
    fill: #fffaf0;
  }


  .level-btn[data-level="level3"] .level-dot:nth-of-type(1),
  .level-btn[data-level="level3"] .level-dot:nth-of-type(2),
  .level-btn[data-level="level3"] .level-dot:nth-of-type(3),
  .level-btn[data-level="level3"] .level-dot:nth-of-type(4) {
    fill: #fffaf0;
  }


  .piece-btn {
    padding: 0.45rem;
  }


  .piece-btn .piece-glyph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2rem;
    line-height: 1;
    color: #fffaf0;
    user-select: none;
  }


  /* Emoji theme icons render with more visual weight/bounding box than
     the chess glyphs, so the shared padding above leaves them looking
     cramped against the circle's edge — give this button extra breathing
     room and shrink the glyph to match. */
  #theme-icon {
    padding: 0.7rem;
  }


  #theme-icon .piece-glyph {
    font-size: 1.5rem;
  }


  /* Piece-switch icon: shows the actual friendly-character board art
     (via the --char-* custom properties shared with the piece-w* rules
     below), not a Unicode chess glyph — those fall back to inconsistent
     substitute glyphs depending on the platform's installed fonts.
     Recolored with --piece-filter so it always matches the active theme,
     same as the piece currently on the board. */
  #piece-icon .piece-glyph {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: var(--piece-filter);
  }


  #piece-icon[data-piece="rook"] .piece-glyph {
    background-image: var(--active-rook);
  }


  #piece-icon[data-piece="bishop"] .piece-glyph {
    background-image: var(--active-bishop);
  }


  #piece-icon[data-piece="queen"] .piece-glyph {
    background-image: var(--active-queen);
  }


  #piece-icon[data-piece="knight"] .piece-glyph {
    background-image: var(--active-knight);
  }


  #piece-icon[data-piece="king"] .piece-glyph {
    background-image: var(--active-king);
  }


  /* Piece-set toggle icon: always previews the rook art, since a fixed
     reference piece is easier to read at a glance than one that also
     changes with the piece-switch button above. */
  #pieceset-icon .piece-glyph {
    background-image: var(--active-rook);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: var(--piece-filter);
  }


  .stats {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--panel-border);
  }


  .stat {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.4rem;
  }


  .stat .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-dark);
  }


  .stat .label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
  }


  .controls {
    width: 320px;
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.1rem 1.2rem;
    border-radius: 20px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    box-shadow: 0 12px 30px rgba(90, 70, 30, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    box-sizing: border-box;
  }


  /*
   * The full stats/hint/banner sidebar is hidden for now — kids don't
   * need a moves/time readout mid-game. Its markup and JS wiring stay
   * intact (untouched, off-screen) so it's easy to bring pieces of it
   * back later. The restart icon is the only control kept visible,
   * floated on the board panel itself.
   */
  .controls {
    display: none;
  }


  button {
    font: inherit;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background: #fffdf6;
    color: var(--ink);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
  }


  button:hover {
    background: #fff3dc;
  }


  button.primary {
    background: linear-gradient(180deg, #dc9a4c, var(--accent));
    border-color: var(--accent-dark);
    color: #fffaf0;
    font-weight: 600;
  }


  button.primary:hover {
    background: linear-gradient(180deg, #e2a55a, #cf8438);
  }


  #hint {
    min-height: 1.4rem;
    font-size: 0.85rem;
    color: var(--moss-dark);
  }


  .lose-banner {
    display: none;
    background: #fbece2;
    border: 2px solid #c0603a;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
  }


  .lose-banner.show {
    display: block;
  }


  .lose-banner h2 {
    margin: 0 0 0.3rem;
    color: #a3492a;
  }


  /* Swaps the collectible artwork per theme — these change shape, not
     just color, so each theme provides its own --sweet1/2/3-img. */
  g-chess-board::part(piece-wc) {
    background-image: var(--sweet1-img);
  }


  g-chess-board::part(piece-wd) {
    background-image: var(--sweet2-img);
  }


  g-chess-board::part(piece-wg) {
    background-image: var(--sweet3-img);
  }


  /*
   * Grass wall obstacle. There are 16 variants (customPieceTypes letters
   * a,e,f,h,i,j,m,o,s,t,u,v,w,x,y,z), one per combination of which of the
   * four orthogonal neighbors is also grass, so adjoining walls fuse into
   * one continuous meadow patch instead of 16 separate isolated tufts.
   * The inset/rounding for unconnected edges is baked into each SVG via
   * a clipPath (not CSS padding), so connected edges are pixel-flush
   * against the neighboring tile with no seam.
   */
  g-chess-board::part(piece-wa),
  g-chess-board::part(piece-we),
  g-chess-board::part(piece-wf),
  g-chess-board::part(piece-wh),
  g-chess-board::part(piece-wi),
  g-chess-board::part(piece-wj),
  g-chess-board::part(piece-wm),
  g-chess-board::part(piece-wo),
  g-chess-board::part(piece-ws),
  g-chess-board::part(piece-wt),
  g-chess-board::part(piece-wu),
  g-chess-board::part(piece-wv),
  g-chess-board::part(piece-ww),
  g-chess-board::part(piece-wx),
  g-chess-board::part(piece-wy),
  g-chess-board::part(piece-wz) {
    padding: 0;
    background-size: 100% 100%;
    filter: var(--terrain-filter);
    transition: filter 0.4s ease;
  }


  g-chess-board::part(piece-wa) {
    background-image: url("terrain/grass-a.svg");
  }


  g-chess-board::part(piece-we) {
    background-image: url("terrain/grass-e.svg");
  }


  g-chess-board::part(piece-wf) {
    background-image: url("terrain/grass-f.svg");
  }


  g-chess-board::part(piece-wh) {
    background-image: url("terrain/grass-h.svg");
  }


  g-chess-board::part(piece-wi) {
    background-image: url("terrain/grass-i.svg");
  }


  g-chess-board::part(piece-wj) {
    background-image: url("terrain/grass-j.svg");
  }


  g-chess-board::part(piece-wm) {
    background-image: url("terrain/grass-m.svg");
  }


  g-chess-board::part(piece-wo) {
    background-image: url("terrain/grass-o.svg");
  }


  g-chess-board::part(piece-ws) {
    background-image: url("terrain/grass-s.svg");
  }


  g-chess-board::part(piece-wt) {
    background-image: url("terrain/grass-t.svg");
  }


  g-chess-board::part(piece-wu) {
    background-image: url("terrain/grass-u.svg");
  }


  g-chess-board::part(piece-wv) {
    background-image: url("terrain/grass-v.svg");
  }


  g-chess-board::part(piece-ww) {
    background-image: url("terrain/grass-w.svg");
  }


  g-chess-board::part(piece-wx) {
    background-image: url("terrain/grass-x.svg");
  }


  g-chess-board::part(piece-wy) {
    background-image: url("terrain/grass-y.svg");
  }


  g-chess-board::part(piece-wz) {
    background-image: url("terrain/grass-z.svg");
  }


  /* The dangerous monster chasing the rook, mapped via customPieceTypes letter l (black) */
  g-chess-board::part(piece-bl) {
    background-image: url("monster.svg");
    filter: var(--enemy-filter);
    transition: filter 0.4s ease;
  }
@media (max-width: 700px) { .board-wrap { width: min(100%, 92vh); padding: 0.5rem; } }
#restart-icon:hover svg { transform: rotate(-25deg); }
