﻿:root{
  --accent: #b7a4ff; /* 숫자야구와 유사한 라벤더 톤 */
  --card-bg: var(--accent); /* fallback */
  --card-bg: color-mix(in srgb, var(--accent) 10%, #ffffff);
  --card-border: var(--accent); /* fallback */
  --card-border: color-mix(in srgb, var(--accent) 24%, #ffffff);
  --card-shadow: 0 12px 28px rgba(52,41,94,0.08);
  --primary-bg: var(--accent); /* fallback */
  --primary-bg: color-mix(in srgb, var(--accent) 70%, #ffffff);
  --primary-border: var(--accent); /* fallback */
  --primary-border: color-mix(in srgb, var(--accent) 55%, #ffffff);
  --text-main:#1f2233;
  --text-sub:#5b6170;
}

.tt-entry-shell{
  display:flex;
  justify-content:center;
  padding:24px 12px 36px;
}
.tt-entry-card{
  width:min(539px, 96vw);
  background: var(--accent); /* fallback */
  background: color-mix(in srgb, var(--accent) 18%, #ffffff);
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 32%, #ffffff);
  border-radius:22px;
  box-shadow: 0 18px 36px rgba(0,0,0,0.06);
  padding:32px 28px 30px;
  display:flex;
  flex-direction:column;
  gap:18px;
}
.tt-header{
  display:flex;
  justify-content:flex-start;
  align-items:flex-start;
  gap:10px;
}
.nb-header{margin-bottom:4px;}
.nb-title{
  font-size:32px;
  font-weight:800;
  color:var(--text-main);
}
.nb-sub{
  margin-top:6px;
  font-size:14px;
  color: var(--text-sub);
  font-weight:400;
}
.nb-rule{
  font-size:12px;
  color:var(--text-sub);
  margin-top:4px;
}
.nb-form{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.nb-section{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.nb-label{
  font-size:13px;
  font-weight:800;
  color: var(--text-main); /* fallback */
  color:color-mix(in srgb, var(--text-main) 82%, #ffffff);
}
.nb-seg{
  box-sizing:border-box;
  display:flex;
  justify-content:center;
  gap:16px;
  background:#ffffff;
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 16%, #ffffff);
  border-radius:999px;
  padding:10px 14px;
  box-shadow: none;
  width:100%;
  max-width:100%;
  margin:0 auto;
}
.nb-seg-item{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.nb-seg-item input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.nb-seg-item span{
  min-width:88px;
  text-align:center;
  padding:0 16px;
  height:38px;
  min-height:38px;
  border-radius:999px;
  font-weight:700;
  color: var(--text-main); /* fallback */
  color:color-mix(in srgb, var(--text-main) 78%, #ffffff);
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:38px;
}
.nb-seg-item input:checked + span{
  background: var(--accent); /* fallback */
  background: color-mix(in srgb, var(--accent) 18%, #ffffff);
  color:var(--text-main);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.nb-switch{
  display:inline-flex;
  align-items:center;
}
.nb-switch input{
  position:absolute;
  opacity:0;
}
.nb-switch-track{
  width:56px;
  height:30px;
  border-radius:999px;
  background:#eef2ff;
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 24%, #ffffff);
  position:relative;
  cursor:pointer;
  transition: background 0.2s ease;
}
.nb-switch-track::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#ffffff;
  box-shadow:0 2px 6px rgba(15,23,42,0.12);
  transition: transform 0.2s ease;
}
.nb-switch input:checked + .nb-switch-track{
  background: var(--accent); /* fallback */
  background: color-mix(in srgb, var(--accent) 30%, #ffffff);
}
.nb-switch input:checked + .nb-switch-track::after{
  transform: translateX(24px);
}
.tt-custom-input{
  display:flex;
  align-items:center;
  gap:8px;
}
.tt-timer-row{
  display:flex;
  align-items:center;
  gap:10px;
}
.tt-timer-input{
  width:120px;
  background: var(--accent); /* fallback */
  background: color-mix(in srgb, var(--accent) 10%, #ffffff);
  border: var(--accent); /* fallback */
  border: 1px solid color-mix(in srgb, var(--accent) 28%, #ffffff);
  color: #1f2937;
  border-radius:14px;
  padding:8px 12px;
}
.tt-timer-input:disabled{
  opacity:0.55;
  background:#f4f1eb;
  border-color:#e8ddcc;
  color:#6b7280;
}
.tt-unit{
  font-size:13px;
  color:var(--text-sub);
  font-weight:700;
}
.tt-unit.muted{
  font-weight:600;
  opacity:0.75;
}
.tt-status-line{
  margin-top:6px;
  font-size:13px;
  font-weight:700;
  color:var(--text-sub);
}
.nb-summary{
  font-size:14px;
  font-weight:500;
  color:var(--text-main);
  margin-top:4px;
  opacity:0.78;
}
.nb-summary-muted{
  color: #6b7280;
  font-weight:500;
  line-height:1.35;
}

/* Dark mode readability for entry card */
html[data-mode="dark"] .tt-entry-card{
  color:#f8f8f8;
}
html[data-mode="dark"] .tt-entry-card .nb-title{ color:#ffffff; }
html[data-mode="dark"] .tt-entry-card .nb-sub,
html[data-mode="dark"] .tt-entry-card .nb-label,
html[data-mode="dark"] .tt-entry-card .nb-rule,
html[data-mode="dark"] .tt-entry-card .nb-summary,
html[data-mode="dark"] .tt-entry-card .tt-unit{
  color:#f2f2f2;
}
.nb-start{
  box-sizing:border-box;
  width:min(460px, 100%);
  max-width:100%;
  margin: 0 auto;
  border-radius:16px;
  padding:14px 16px;
  background: var(--primary-bg);
  color: #0f172a;
  border: 1px solid var(--primary-border);
  font-weight:800;
  box-shadow: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.nb-start:hover{
  background: var(--accent); /* fallback */
  background: color-mix(in srgb, var(--accent) 78%, #ffffff);
  border-color: var(--accent); /* fallback */
  border-color: color-mix(in srgb, var(--accent) 62%, #ffffff);
  box-shadow: none;
}

/* Ensure start button override wins over .btn defaults */
.tt-entry-card .nb-start{
  background: var(--gp-entry-button-bg) !important;
  border: 1px solid var(--gp-entry-button-border) !important;
  color: #ffffff !important;
}
.nb-start:active{ transform:translateY(1px); }

/* Switch (match maze) */
.nb-switch{
  display:inline-flex;
  align-items:center;
}
.nb-switch input{ position:absolute; opacity:0; }
.nb-switch-track{
  width:44px;
  height:24px;
  border-radius:24px;
  background:#e6e1d8;
  border:1px solid transparent;
  position:relative;
  cursor:pointer;
  transition: background 0.2s ease;
}
.nb-switch-track::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:18px;
  height:18px;
  border-radius:50%;
  background:#ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}
.nb-switch input:checked + .nb-switch-track{
  background: var(--accent); /* fallback */
  background: color-mix(in srgb, var(--accent) 70%, #ffffff);
}
.nb-switch input:checked + .nb-switch-track::after{
  transform: translateX(20px);
}

.tt-shell{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100%;
  box-sizing:border-box;
  padding:12px 8px 24px;
}
.tt-card{
  width:fit-content;
  max-width:466px;
  border-radius:16px;
  background: var(--accent); /* fallback */
  background:color-mix(in srgb, var(--accent) 12%, #ffffff);
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 26%, #ffffff);
  box-shadow: var(--card-shadow);
  padding:12px 12px 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  box-sizing:border-box;
  margin:0 auto;
  overflow:hidden;
}
.tt-card--result{
  background: var(--gp-card-bg);
  border:3px solid var(--gp-card-border);
  box-shadow: var(--gp-card-shadow, var(--card-shadow));
}
.tt-body.tt-body--single{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:100%;
  max-width:100%;
  margin:0 auto;
}
.tt-card--wide{
  width:min(466px, 96vw);
  max-width:466px;
}
.tt-headline{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.tt-headline h1{margin:0;font-size:32px;font-weight:800;color:var(--text-main);}
.tt-headline .text-sub{margin:6px 0 0;color:var(--text-sub);font-weight:600;font-size:13px;}
.tt-headline-text{display:flex;flex-direction:column;gap:5px;}
.tt-meta{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:4px;}
.tt-meta--row{margin:0;}
.tt-headline-actions{margin-left:auto;gap:10px;}
.tt-meta-line{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  font-weight:700;
  color:var(--text-main);
  padding:6px 0;
}
.tt-top-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.chipset{display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
.chip{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:9px 12px;
  border-radius:12px;
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 22%, #ffffff);
  background:#fff;
  font-weight:700;
  color:var(--text-main);
  box-shadow: var(--accent); /* fallback */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, #ffffff);
}
.chip.muted{font-weight:600;}
.actions{display:flex;gap:8px;flex-wrap:wrap;width:100%;}
.actions.inline{justify-content:flex-end;margin-top:6px;}
.btn{
  text-decoration:none;
  padding:10px 14px;
  border-radius:12px;
  font-weight:700;
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 22%, #ffffff);
  background:#fff;
  color:var(--text-main);
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn.primary{
  background: var(--accent); /* fallback */
  background:color-mix(in srgb, var(--accent) 65%, #ffffff);
  border-color: var(--accent); /* fallback */
  border-color:color-mix(in srgb, var(--accent) 70%, #ffffff);
  box-shadow:0 10px 22px rgba(92,122,200,0.16);
}
.btn.primary:hover{transform:translateY(-2px);box-shadow:0 14px 26px rgba(92,122,200,0.18);}
.btn.ghost{background:transparent;}
.btn.full{width:100%;display:flex;justify-content:center;}
.btn.primary.full{padding:16px;font-size:15px;}

.tt-body.entry{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.tt-body{
  display:grid;
  grid-template-columns:1fr minmax(260px, 340px);
  gap:16px;
  align-items:start;
  justify-content:center;
}
.tt-body.tt-body--game{
  grid-template-columns:minmax(360px, 1.05fr) minmax(260px, 0.8fr);
}
.tt-board{
  width:min(434px, 100%);
  max-width:434px;
  aspect-ratio:1/1;
  background:#ffffff;
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 22%, #ffffff);
  border-radius:16px;
  display:grid;
  grid-auto-rows:1fr;
  gap:12px;
  box-shadow: var(--accent); /* fallback */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, #ffffff);
  padding:12px;
  box-sizing:border-box;
  margin:0 auto;
}
.tt-cell{
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: clamp(32px, 6vw, 64px);
  font-weight:800;
  color:var(--text-main);
  cursor:pointer;
  border: var(--accent); /* fallback */
  border:2px solid color-mix(in srgb, var(--accent) 14%, #ffffff);
  background: var(--accent); /* fallback */
  background:color-mix(in srgb, var(--accent) 6%, #ffffff);
  position:relative;
  aspect-ratio:1/1;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.tt-num{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:800;
  color:#1f2233;
  pointer-events:none;
}
.tt-cell:hover{background:color-mix(in srgb, var(--accent) 10%, #ffffff);}
.tt-cell.win{background:color-mix(in srgb, var(--accent) 14%, #ffffff); color:#0b1b3a;}
.tt-info{display:grid;gap:10px;}
.tt-board-wrap{
  width:100%;
  max-width:466px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}
.panel{
  background: var(--accent); /* fallback */
  background:color-mix(in srgb, var(--accent) 8%, #ffffff);
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 22%, #ffffff);
  border-radius:16px;
  padding:12px 14px;
  box-shadow:0 6px 16px rgba(15,23,42,0.06);
}
.panel-title{font-weight:800;margin-bottom:8px;color:var(--text-main);}
.stat-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:8px 10px;
  border-radius:10px;
  background: var(--accent); /* fallback */
  background:color-mix(in srgb, var(--accent) 4%, #ffffff);
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 16%, #ffffff);
  font-weight:600;
  font-size:13.5px;
  color:var(--text-main);
  margin-bottom:4px;
}
.stat-row:last-child{margin-bottom:0;}
.result-hint{
  margin:8px 0 0;
  font-size:12px;
  color:var(--text-sub);
  opacity:0.75;
}

.form-grid{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));}
.tt-label{display:flex;flex-direction:column;gap:5px;font-weight:700;color:var(--text-main);}
.tt-input{
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 22%, #ffffff);
  border-radius:12px;
  padding:10px 12px;
  font-weight:700;
  font-size:14px;
}
.tt-input.slim{padding:8px 10px;}
.pill-group{display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
.pill-container{
  display:flex;
  flex-wrap:nowrap;
  gap:10px;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:16px;
  background:#ffffff !important;
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 18%, #ffffff);
  width:100%;
  box-shadow: var(--accent); /* fallback */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 8%, #ffffff);
}
.pill{
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 16%, #ffffff);
  background:transparent;
  border-radius:12px;
  padding:0 16px;
  height:38px;
  min-height:38px;
  font-weight:700;
  cursor:pointer;
  box-shadow:none;
  min-width:0;
  flex:1 1 0;
  display:flex;
  justify-content:center;
  align-items:center;
  text-align:center;
}
.pill.is-active{
  background: var(--gp-entry-control-active);
  border-color: var(--gp-entry-control-active-border);
  color:var(--gp-entry-control-text);
  box-shadow:0 8px 18px rgba(92,122,200,0.14);
}
.pill-input{
  width:80px;
  border: var(--accent); /* fallback */
  border:1px dashed color-mix(in srgb, var(--accent) 26%, #ffffff);
  text-align:center;
}
.hidden{display:none;}
.field-block{display:flex;flex-direction:column;gap:8px;}
.field-label{font-weight:800;color:var(--text-main);font-size:13px;}
.seg{display:flex;gap:8px;flex-wrap:wrap;}
.seg-btn{
  border-radius:10px;
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 18%, #ffffff);
  padding:8px 12px;
  background:#fff;
  font-weight:700;
  cursor:pointer;
}
.seg-btn.is-active{
  background: var(--accent); /* fallback */
  background:color-mix(in srgb, var(--accent) 22%, #ffffff);
  border-color: var(--accent); /* fallback */
  border-color:color-mix(in srgb, var(--accent) 32%, #ffffff);
  box-shadow:0 6px 12px rgba(92,122,200,0.12);
}

/* Result layout reuse */
.result-body.nb-like{
  margin-top:6px;
  display:grid;
  grid-template-columns:0.95fr 1.05fr;
  gap:16px;
  align-items:start;
  grid-auto-rows:minmax(0, 1fr);
}
.result-body.nb-like > *{
  min-height:100%;
  display:flex;
  flex-direction:column;
  align-self:stretch;
}
.panel-map{
  display:flex;
  flex-direction:column;
  gap:10px;
  height:100%;
  min-height:520px;
}
.panel-map .panel{
  height:100%;
  display:flex;
  flex-direction:column;
}
.right-col{
  display:flex;
  flex-direction:column;
  height:100%;
  min-height:100%;
}
.right-col > .panel{
  display:flex;
  flex-direction:column;
  height:100%;
}
.panel-map .path-box{padding:0;flex:1;display:flex;justify-content:center;align-items:center;}
.panel-map .path-box{
  overflow:hidden;
  flex:0 0 auto;
  align-self:center;
  width:min(720px, 90%);
  aspect-ratio:1/1;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:14px;
  border: var(--accent); /* fallback */
  border:1px solid color-mix(in srgb, var(--accent) 22%, #ffffff);
  border-radius:14px;
  background:#fff;
}
.path-grid{
  display:grid;
  width:100%;
  height:100%;
  grid-template-columns:repeat(3, 1fr);
  grid-template-rows:repeat(3, 1fr);
  gap:4px;               /* show grid lines via container bg */
  align-items:stretch;
  justify-items:stretch;
  background:#0f172a;    /* black/dark grid lines */
  padding:4px;
  border-radius:12px;
}
.path-grid .cell{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  font-weight:800;
  font-size:36px;
  background:#ffffff;
  border:0;
  position:relative;
  color:#0f172a;
}

@media (max-width: 960px){
  .tt-body{grid-template-columns:1fr;gap:10px;}
  .tt-shell{padding:10px 0 18px;}
}

@media (max-width: 420px){
  .tt-card{
    width: min(100%, calc(100vw - 20px));
    padding: 10px 10px 14px;
  }
  .tt-card--wide{
    width: min(100%, calc(100vw - 20px));
  }
  .tt-top-row{
    flex-wrap: wrap;
  }
  .tt-top-row > *{
    flex: 1 1 auto;
  }
  .tt-board-wrap{
    max-width: 100%;
  }
  .tt-board{
    width: min(320px, calc(100vw - 44px));
    max-width: 100%;
    gap: 8px;
    padding: 8px;
  }
  .tt-cell{
    font-size: clamp(26px, 9vw, 42px);
  }
}

.turn-inline{font-weight:800;color:var(--text-main);padding:6px 10px;border-radius:10px;background:#ffffff;border:1px solid #e3e6ed;box-shadow: inset 0 0 0 1px rgba(170,180,195,0.28);}

/* Size-specific tuning: same board/card size, denser cells on larger grids */
#ttRoot[data-size="5"] .tt-board{
  padding:12px;
  gap:8px;
}
#ttRoot[data-size="5"] .tt-cell{
  font-size: clamp(24px, 4vw, 42px);
  border-width:2px;
}
#ttRoot[data-size="5"] .tt-cell{
  font-size: clamp(20px, 3.6vw, 36px);
}



