:root {
  --green: #064a36;
  --green-dark: #003b2b;
  --gold: #a87820;
  --cream: #fbfaf6;
  --line: #e9e5dc;
  --muted: #6f716f;
  --shadow: 0 8px 24px rgba(48, 56, 46, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: #152019;
  background: radial-gradient(circle at 55% 10%, #fffdf7 0, #fbfaf6 42%, #f5f4ef 100%);
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.topbar {
  height: 114px;
  padding: 20px 48px 16px 60px;
  display: grid;
  grid-template-columns: 280px minmax(320px, 520px) 1fr;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid rgba(226, 222, 212, .7);
  background: rgba(255,255,255,.72);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 76px; height: 70px; object-fit: cover; mix-blend-mode: multiply; }
.brand span { display: grid; font-size: 24px; line-height: 1.05; color: var(--green-dark); }
.brand em { color: var(--gold); font-style: normal; }
.search { height: 40px; padding: 0 15px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 24px; background: white; color: var(--gold); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.account { justify-self: end; display: flex; align-items: center; gap: 13px; font-size: 13px; }
.icon-button { position: relative; border: 0; background: none; font-size: 29px; color: var(--green-dark); }
.notice i { position: absolute; top: 0; right: 0; width: 15px; height: 15px; border-radius: 50%; color: white; background: #cf3434; font-size: 9px; font-style: normal; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 60% 35%, #ebc59f 0 22%, #29483b 23%); color: white; }

.app-layout { display: grid; grid-template-columns: 212px minmax(0, 1fr); }
.sidebar {
  min-height: calc(100vh - 114px);
  padding: 25px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f5d88c;
  background: radial-gradient(circle at 20% 10%, #0b5b43, var(--green-dark) 50%, #002d22);
}
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { padding: 13px 14px; display: flex; align-items: center; gap: 14px; border-radius: 12px; font-size: 15px; font-weight: 700; }
.sidebar nav a.active, .sidebar nav a:hover { background: rgba(255,255,255,.12); }
.sidebar nav span { width: 25px; font-size: 25px; text-align: center; }
.sidebar small { margin-left: auto; padding: 2px 6px; border-radius: 8px; color: white; background: #c99c40; font-size: 8px; }
.side-quote { padding: 18px; border: 1px solid rgba(247,220,153,.45); border-radius: 12px; color: white; font-size: 13px; }
.side-quote b { color: #a9c3b6; font-size: 30px; }
.side-quote hr { width: 48px; margin: 16px 0; border: 0; border-top: 1px solid rgba(255,255,255,.45); }
.side-quote span { font-size: 11px; line-height: 1.8; }

main { min-width: 0; padding: 0 32px 20px 10px; }
.hero-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(310px, .95fr); gap: 12px; }
.hero {
  position: relative;
  min-height: 230px;
  padding: 38px 7%;
  overflow: hidden;
  background: radial-gradient(circle at 35% 55%, #fffdf8 0, rgba(255,255,255,.55) 40%, rgba(237,230,208,.65) 100%);
}
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 54px; background: linear-gradient(transparent, rgba(20,83,55,.09)); }
.hero-copy { position: relative; z-index: 2; }
.hero h1 { margin: 0 0 18px; font-family: Georgia, "Batang", serif; font-size: clamp(30px, 3vw, 44px); font-weight: 500; letter-spacing: .03em; }
.mobile-break { display: none; }
.hero h2 { margin: 0 0 12px; font-size: 19px; }
.hero p { margin: 0; font-size: 16px; line-height: 1.7; }
.hero > img { position: absolute; z-index: 1; right: 2%; bottom: -55px; width: min(45%, 420px); mix-blend-mode: multiply; }
.hero-actions, .hero .dots { display: none; }

.card { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.72); box-shadow: var(--shadow); }
.section-head { min-height: 46px; padding: 15px 18px 8px; display: flex; align-items: center; justify-content: space-between; }
.section-head h3 { margin: 0; color: #153c2f; font-size: 15px; }
.section-head a { color: #58645d; font-size: 9px; }
.growth { margin: 4px 0 8px; padding: 4px 0 14px; align-self: center; }
.stat-grid { padding: 0 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { min-height: 76px; padding: 10px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.75); }
.stat-icon { width: 38px; color: var(--green); font-size: 30px; text-align: center; }
.stat-icon.gold { color: var(--gold); }
.stat-icon.red { color: #c5303c; }
.stat p { margin: 0; display: grid; font-size: 10px; color: #4d5752; }
.stat strong { color: var(--green-dark); font-size: 25px; font-weight: 600; line-height: 1; }
.stat small { color: var(--gold); font-size: 9px; font-weight: 400; }

.dashboard-grid { display: grid; grid-template-columns: 1.05fr 1fr .85fr 1.2fr; gap: 10px; }
.journal { grid-row: span 2; padding-bottom: 12px; }
.timeline { padding: 2px 16px; }
.log { position: relative; min-height: 92px; display: grid; grid-template-columns: 48px 26px 1fr; gap: 7px; }
.log::after { content: ""; position: absolute; left: 60px; top: 28px; bottom: 0; border-left: 1px solid #d7d4cd; }
.log:last-child::after { display: none; }
.log time { padding-top: 8px; color: #686f6b; font-size: 12px; }
.log i { z-index: 1; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: white; font-size: 10px; font-style: normal; }
.win { background: var(--green); }
.lose { background: #cb3f48; }
.log div { display: grid; grid-template-columns: 1fr auto; align-content: start; font-size: 11px; }
.log small { color: #5f6863; }
.log strong, .log p { grid-column: span 2; }
.log strong { margin-top: 4px; font-size: 10px; }
.log p { margin: 0; color: #39413d; line-height: 1.55; }
.wide-button { display: none; width: calc(100% - 30px); margin: 5px 15px 0; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: white; font-weight: 700; }

.insight { position: relative; padding-bottom: 10px; text-align: center; }
.insight blockquote { margin: 0 12px 10px; padding: 28px 20px; border-radius: 12px 12px 0 0; color: white; background: linear-gradient(140deg, #28633b, #00452f); font: 21px/1.6 Georgia, "Batang", serif; text-align: left; }
.insight blockquote b { display: block; color: rgba(255,255,255,.3); font-size: 36px; line-height: .7; }
.mini-quote { height: 144px; margin: 0 12px; padding: 28px; display: grid; place-content: center; border: 1px solid var(--line); border-radius: 12px; font: 20px/1.7 Georgia, "Batang", serif; }
.dots { display: flex; justify-content: center; gap: 10px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #ddd8cc; }
.dots i:first-child { background: var(--gold); }
.insight .dots { margin-top: -18px; }

.replay { grid-column: span 2; padding: 0 12px 12px; }
.replay .section-head { padding-left: 0; padding-right: 0; }
.video { position: relative; overflow: hidden; border-radius: 8px; color: white; background: #111; }
.video img { width: 100%; aspect-ratio: 1.95; display: block; object-fit: cover; filter: brightness(.82); }
.video .play { position: absolute; top: 50%; left: 50%; width: 48px; height: 48px; display: grid; place-items: center; transform: translate(-50%,-50%); border-radius: 50%; background: rgba(0,50,38,.8); }
.video b { position: absolute; top: 12px; left: 14px; font-size: 11px; }
.video small { position: absolute; right: 12px; bottom: 10px; }
.chapters { margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; }
.chapters li { padding: 9px 6px; display: grid; border: 1px solid var(--line); border-radius: 8px; color: #3b443f; font-size: 10px; text-align: center; }
.chapters li span { display: none; }
.chapters time { font-size: 12px; }

.library { grid-column: span 2; padding: 0 12px 12px; }
.library .section-head { padding-left: 0; padding-right: 0; }
.match-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.match { min-width: 0; display: grid; gap: 5px; color: #252e29; font-size: 10px; }
.match img { width: 100%; aspect-ratio: 1.55; object-fit: cover; border: 2px solid #0b2730; border-radius: 6px; background: #065cac; }
.match b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.match span { color: #8e8064; }
.match small { padding: 4px; border: 1px solid #e6dcc8; border-radius: 4px; color: #9c722d; white-space: nowrap; }

.coach { grid-column: span 1; grid-row: span 2; padding-bottom: 12px; }
.coach .donut { width: 82px; aspect-ratio: 1; margin: 4px 12px; float: left; border-radius: 50%; background: conic-gradient(var(--green) 0 42%, #d49a2e 42% 73%, #c83e43 73%); mask: radial-gradient(circle, transparent 0 38%, #000 39%); }
.coach ul { margin: 10px 0 14px; padding: 0; display: grid; gap: 8px; list-style: none; font-size: 10px; }
.coach p { clear: both; margin: 8px 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 10px; line-height: 1.7; }
.graph-card { grid-column: span 2; }
.graph-card h4 { margin: 0 15px; font-size: 10px; }
.graph { position: relative; height: 130px; margin: 0 20px 12px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0 32px, #eee 33px); }
.graph::after { content: ""; position: absolute; inset: 25px 0 auto; height: 2px; transform: rotate(-11deg); background: var(--green); transform-origin: left; }
.graph span { position: absolute; left: var(--x); top: var(--y); color: var(--green-dark); font-size: 9px; transform: translate(-50%,-100%); }
.graph span::after { content: ""; display: block; width: 8px; height: 8px; margin: 3px auto; border-radius: 50%; background: var(--green); }
.community { grid-column: span 2; padding-bottom: 10px; }
.community p { margin: 4px 18px; font-size: 10px; }
.community b { float: right; color: var(--gold); }
.quick { grid-column: span 2; }
.quick > div { padding: 0 10px 10px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.quick a { padding: 8px 3px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; font-size: 10px; }
.quick img { width: 43px; height: 38px; object-fit: contain; }
.mobile-nav { display: none; }

@media (max-width: 1100px) {
  .topbar { padding-left: 28px; grid-template-columns: 240px minmax(250px, 440px) 1fr; }
  .app-layout { grid-template-columns: 180px minmax(0,1fr); }
  .sidebar { padding: 20px 12px; }
  .sidebar nav a { padding: 11px 9px; font-size: 12px; }
  main { padding-right: 16px; }
}

@media (max-width: 820px) {
  body { padding-bottom: 88px; }
  .topbar {
    height: 94px;
    padding: 16px 28px;
    grid-template-columns: 1fr auto;
    border: 0;
    background: transparent;
  }
  .brand { gap: 8px; }
  .brand img { width: 62px; height: 57px; }
  .brand span { font-size: 18px; }
  .search, .account strong, .account > span { display: none; }
  .account { grid-column: 2; gap: 12px; }
  .avatar { width: 44px; height: 44px; }
  .app-layout { display: block; }
  .sidebar { display: none; }
  main { padding: 0 14px 18px; }
  .hero-row { display: block; }
  .hero {
    min-height: 342px;
    padding: 24px 22px;
    border-radius: 14px;
    background: radial-gradient(circle at 30% 25%, #fffdf8 0, rgba(255,255,255,.6) 45%, #e7eadb 100%);
    box-shadow: var(--shadow);
  }
  .hero-copy { position: static; }
  .hero h1 { width: 100%; margin-bottom: 16px; font-size: clamp(28px, 6.5vw, 36px); line-height: 1.5; }
  .mobile-break { display: block; }
  .hero h2 { display: none; }
  .hero p { font-size: 13px; }
  .hero > img { right: -15px; bottom: 4px; width: 63%; }
  .hero-actions { position: absolute; z-index: 3; left: 22px; bottom: 46px; display: flex; gap: 10px; }
  .hero-actions a { padding: 12px 16px; border-radius: 8px; font-size: 11px; font-weight: 700; box-shadow: 0 5px 14px rgba(0,0,0,.08); }
  .primary-button { color: white; background: var(--green); }
  .secondary-button { background: white; }
  .hero .dots { position: absolute; z-index: 4; bottom: 14px; left: 50%; display: flex; }
  .growth { margin: 10px 0; padding-bottom: 10px; }
  .section-head { min-height: 42px; padding: 12px 12px 7px; }
  .section-head h3 { font-size: 14px; }
  .section-head a { font-size: 9px; }
  .stat-grid { padding: 0 8px; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .stat { min-height: 78px; padding: 8px 5px; display: grid; place-items: center; gap: 0; text-align: center; }
  .stat-icon { width: auto; font-size: 26px; }
  .stat p { font-size: 8px; }
  .stat strong { font-size: 20px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .journal { grid-column: 1; grid-row: span 2; }
  .insight { grid-column: 2; }
  .replay  { grid-column: 2; }
  .library { grid-column: span 2; grid-row: auto; }
  /* community·quick는 wrapper 내부에서 처리하므로 숨기지 않음 */
  .coach, .graph-card { display: none; }
  .timeline { padding: 0 10px; }
  .log { min-height: 103px; grid-template-columns: 42px 23px 1fr; gap: 4px; }
  .log::after { left: 53px; }
  .log time { font-size: 10px; }
  .log i { width: 20px; height: 20px; }
  .log div { font-size: 9px; }
  .log p { font-size: 8px; }
  .wide-button { display: block; font-size: 10px; }
  .insight blockquote { margin: 0 8px 8px; padding: 22px 14px; font-size: clamp(16px, 3vw, 22px); }
  .mini-quote { display: none; }
  .insight .dots { margin: 7px 0 4px; }
  .replay { padding: 0 8px 8px; }
  .replay .video b { font-size: 8px; }
  .video .play { width: 36px; height: 36px; font-size: 11px; }
  .chapters { grid-template-columns: 1fr; margin-top: 4px; }
  .chapters li { padding: 5px 2px; display: grid; grid-template-columns: 14px 38px 1fr; border-width: 0 0 1px; border-radius: 0; text-align: left; }
  .chapters li span { display: block; color: var(--gold); }
  .chapters time, .chapters b { font-size: 8px; }
  .match-grid { gap: 8px; }
  .match { font-size: 8px; }
  .match b { font-size: 9px; }
  .match small { overflow: hidden; font-size: 7px; text-overflow: ellipsis; }
  .mobile-nav {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    height: 78px;
    padding: 9px 13px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    background: rgba(255,255,255,.96);
    box-shadow: 0 -7px 20px rgba(32,44,36,.06);
  }
  .mobile-nav a { display: grid; place-items: center; align-content: center; gap: 3px; color: #505651; font-size: 9px; }
  .mobile-nav span { font-size: 22px; line-height: 1; }
  .mobile-nav .active { color: var(--green); font-weight: 700; }
  .mobile-nav .add span { width: 48px; height: 48px; display: grid; place-items: center; margin-top: -30px; border-radius: 50%; color: white; background: var(--green); font-size: 30px; box-shadow: 0 5px 15px rgba(0,74,52,.25); }

  /* 3s.png 게임 시작 버튼 */
  .game-start-btn {
    width: 64px;
    height: 64px;
    margin-top: -26px;
    border-radius: 50%;
    background: url('/static/images/3s.png') center/cover no-repeat;
    box-shadow: 0 6px 18px rgba(0,74,52,.3);
    border: 3px solid rgba(255,255,255,.85);
    flex-shrink: 0;
  }
  .game-start-btn:hover { opacity: .88; }
}

/* ── 대시보드 페어 wrapper ───────────────────────────── */
.db-pair-wrap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}
@media (max-width: 820px) {
  .db-pair-wrap {
    grid-column: span 2;   /* 2열 대시보드에서 전체 폭 */
    grid-template-columns: 1fr;  /* 모바일: 세로 배치 */
  }
  /* 빠른 메뉴 모바일: 3열 */
  .quick > div { grid-template-columns: repeat(3, 1fr); }
  /* community 모바일 표시 */
  .community { display: block; }
}

@media (max-width: 480px) {
  .topbar { height: 90px; padding: 14px 18px; }
  .brand img { width: 55px; height: 50px; }
  .brand span { font-size: 16px; }
  .icon-button { font-size: 24px; }
  .avatar { width: 38px; height: 38px; }
  main { padding: 0 9px 15px; }
  .hero { min-height: 320px; padding: 19px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 11px; }
  .hero-actions { left: 18px; bottom: 42px; gap: 6px; }
  .hero-actions a { padding: 10px; font-size: 9px; }
  .stat { min-height: 70px; }
  .stat-icon { font-size: 22px; }
  .stat strong { font-size: 17px; }
  .dashboard-grid { gap: 6px; }
  .section-head h3 { font-size: 12px; }
  .journal .section-head a { display: none; }
  .log { min-height: 100px; grid-template-columns: 35px 19px 1fr; }
  .log::after { left: 44px; }
  .log i { width: 18px; height: 18px; font-size: 8px; }
  .log div { font-size: 8px; }
  .log p { font-size: 7px; }
  .library { padding: 0 7px 8px; }
  .match-grid { gap: 5px; }
  .match b { font-size: 8px; }
  .match span, .match small { font-size: 6px; }
}
