/* =========================
   COTTAGE BOARD - style.css
   주석 포함 재정리본

   기준
   - 현재 owned-games.html / script.js 구조 기준
   - 정렬·필터 compact toolbar 구조 유지
   - 추천게임 / 전체게임 / 검색 / 상세시트 동작 선택자 유지
   - 기존 임시 복구 코드는 정식 섹션에 반영

   목차
   1. RESET / TOKENS
   2. HEADER / SEARCH
   3. HERO
   4. RECOMMEND SECTION
   5. RECOMMEND FILTER / MODAL
   6. GAME CARD / GAME SHEET
   7. OWNED GAMES PAGE
   8. OWNED SEARCH + SORT/FILTER TOOLBAR
   9. RESPONSIVE
========================= */

/* =========================
   # 1. RESET / TOKENS
========================= */

:root{
  --header-h:clamp(52px,13vw,68px);
  --page-x:clamp(18px,5vw,24px);
  --safe-top:env(safe-area-inset-top);
  --safe-bottom:env(safe-area-inset-bottom);

  --bg:#f7f0e3;
  --paper:#fffdf8;
  --paper-2:#fffaf0;
  --cream:#fff8ea;
  --line:#e7dbc7;
  --line-strong:#dfc7a1;

  --green:#35543c;
  --green-2:#4f7445;
  --green-3:#6f9448;
  --brown:#74451f;
  --ink:#2f2a21;
  --muted:#6f5d43;

  --selected-pill-bg:#f4f8ee;
  --selected-pill-border:#bdd0a8;
  --selected-pill-text:#526b43;

  --overlay-z:2000;
  --sheet-z:2100;
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  background:var(--bg);
  color:#111;
  font-family:Arial,sans-serif;
}

button,
a{
  -webkit-tap-highlight-color:transparent;
}

button{
  font-family:inherit;
}

input,
textarea{
  -webkit-user-select:text !important;
  user-select:text !important;
  -webkit-touch-callout:default !important;
  touch-action:manipulation;
}

.is-hidden{
  display:none !important;
}

/* =========================
   # 2. HEADER / SEARCH
========================= */

.site-header{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:1000;
  height:var(--header-h);
  padding:0 clamp(12px,4vw,28px);
  display:grid;
  grid-template-columns:clamp(82px,24vw,130px) 1fr auto;
  align-items:center;
  background:var(--bg);
  border-bottom:1px solid rgba(223,199,161,0.45);
}

.header-logo{
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  text-decoration:none;
}

.header-logo img{
  width:clamp(74px,21vw,120px);
  height:auto;
  max-height:calc(var(--header-h) - 10px);
  object-fit:contain;
  display:block;
}

.header-center{
  display:block;
  min-width:0;
  padding:0 10px 0 4px;
  text-align:center;
  color:#3f4036;
  font-size:clamp(12px,3.2vw,15px);
  line-height:1.25;
  font-weight:900;
  letter-spacing:-0.4px;
  white-space:nowrap;
  text-decoration:none;
  cursor:pointer;
}

.header-actions{
  display:flex;
  align-items:center;
  gap:2px;
  justify-self:end;
}

.header-search{
  display:flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border:0;
  background:transparent;
  color:var(--green);
  font-size:20px;
  font-weight:900;
  text-decoration:none;
  cursor:pointer;
}

.header-search:hover{
  opacity:0.7;
}

.menu-toggle{
  justify-self:end;
  width:clamp(38px,10vw,46px);
  height:clamp(38px,10vw,46px);
  border:0;
  background:transparent;
  color:var(--green);
  font-size:clamp(28px,7vw,34px);
  line-height:1;
  cursor:pointer;
}

.header-menu{
  position:absolute;
  top:calc(var(--header-h) - 8px);
  right:16px;
  width:170px;
  display:none;
  flex-direction:column;
  align-items:flex-start;
  gap:10px;
  padding:16px;
  border:1px solid rgba(223,199,161,0.7);
  border-radius:20px;
  background:var(--paper-2);
  box-shadow:0 14px 28px rgba(40,30,18,0.12);
  z-index:1001;
}

.header-menu.active{
  display:flex;
}

.header-menu a{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  color:var(--green);
  text-decoration:none;
  font-size:15px;
  font-weight:900;
}

.header-menu a:hover{
  background:#f3eadc;
}

/* 헤더 검색 패널 */
.header-search-panel{
  position:absolute;
  top:calc(var(--header-h) - 6px);
  left:12px;
  right:12px;
  display:none;
  padding:12px;
  border:1px solid rgba(223,199,161,0.7);
  border-radius:18px;
  background:var(--paper-2);
  box-shadow:0 14px 28px rgba(40,30,18,0.12);
  z-index:1002;
}

.header-search-panel.is-active{
  display:block;
}

.header-search-panel input{
  width:100%;
  height:42px;
  padding:0 14px;
  border:1.5px solid #dfc7a1;
  border-radius:999px;
  background:#fffdf8;
  color:#314d35;
  font-size:15px;
  font-weight:800;
  outline:none;
  -webkit-user-select:text !important;
  user-select:text !important;
  -webkit-touch-callout:default !important;
  pointer-events:auto !important;
}

.header-search-results{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
  position:relative;
  max-height:42svh;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding-right:2px;
  padding-bottom:10px;
}

.header-search-panel::after{
  content:"";
  position:absolute;
  left:14px;
  right:14px;
  bottom:10px;
  height:28px;
  pointer-events:none;
  border-radius:0 0 18px 18px;
  background:linear-gradient(to bottom,rgba(255,253,248,0),rgba(255,250,240,0.95));
}

.header-search-result{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border:1px solid #ead8b8;
  border-radius:14px;
  background:#fffdf8;
  text-align:left;
  cursor:pointer;
}

.header-search-result img{
  width:42px;
  height:42px;
  flex:0 0 42px;
  object-fit:contain;
  border-radius:10px;
  background:#f7f2e8;
}

.header-search-result strong{
  display:block;
  color:#2f2a21;
  font-size:14px;
  font-weight:900;
  line-height:1.25;
}

.header-search-empty{
  margin:8px 2px 0;
  color:#6f5d43;
  font-size:13px;
  font-weight:800;
}

.header-search-hint{
  margin:8px 4px 0;
  opacity:0.82;
  color:#8f8474;
  font-size:11px;
  font-weight:700;
  line-height:1.35;
}

/* 전체게임 페이지에서도 모바일 메뉴 구조 강제 유지 */
body.owned-page .site-header{
  grid-template-columns:clamp(82px,24vw,130px) 1fr auto !important;
}

body.owned-page .header-menu{
  position:absolute !important;
  top:calc(var(--header-h) - 8px) !important;
  right:16px !important;
  width:170px !important;
  display:none !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  gap:10px !important;
  padding:16px !important;
  border:1px solid rgba(223,199,161,0.7) !important;
  border-radius:20px !important;
  background:var(--paper-2) !important;
  box-shadow:0 14px 28px rgba(40,30,18,0.12) !important;
  z-index:1001 !important;
}

body.owned-page .header-menu.active{
  display:flex !important;
}

/* =========================
   # 3. HERO
========================= */

.hero{
  position:relative;
  overflow:hidden;
  min-height:100svh;
  padding:calc(var(--header-h) + clamp(18px,5vw,34px)) var(--page-x) clamp(24px,6vw,48px);
  display:flex;
  align-items:center;
  background:radial-gradient(circle at top center,#fff9ed 0%,#f7f0e3 55%,#efe3cf 100%);
}

.hero::before,
.hero::after{
  content:"";
  position:absolute;
  border-radius:50%;
  pointer-events:none;
}

.hero::before{
  left:-60px;
  top:80px;
  width:220px;
  height:220px;
  background:rgba(120,152,61,0.08);
}

.hero::after{
  right:-80px;
  bottom:80px;
  width:260px;
  height:260px;
  background:rgba(138,75,43,0.06);
}

.hero-inner{
  position:relative;
  z-index:2;
  width:100%;
  max-width:1320px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:clamp(10px,3vw,24px);
}

.hero-deco{
  position:absolute;
  z-index:1;
  color:#78983d;
  opacity:0.45;
  pointer-events:none;
}

.deco-1{left:3%;top:18%;font-size:42px;transform:rotate(90deg);}
.deco-2{right:6%;top:14%;font-size:28px;}
.deco-3{left:6%;bottom:8%;font-size:30px;}

.hero-visual{
  width:100%;
  max-width:clamp(180px,52vw,340px);
  margin:0 auto;
}

.hero-visual img{
  width:100%;
  display:block;
  filter:drop-shadow(0 18px 24px rgba(61,45,28,0.13));
}

.hero-text{
  text-align:center;
}

.label{
  display:inline-block;
  padding:clamp(7px,2vw,9px) clamp(14px,4vw,18px);
  margin-bottom:clamp(10px,3vw,20px);
  border:2px solid #d9be8b;
  border-radius:999px;
  background:#fff8ea;
  color:var(--brown);
  font-size:clamp(13px,3.6vw,15px);
  font-weight:900;
  box-shadow:0 4px 12px rgba(120,90,45,0.06);
}

.hero h1{
  margin:0 0 clamp(10px,3vw,22px);
  color:var(--ink);
  font-size:clamp(26px,7.2vw,52px);
  line-height:1.22;
  font-weight:900;
  letter-spacing:-1px;
}

.dotted-line{
  width:100%;
  max-width:300px;
  height:8px;
  margin:0 auto clamp(12px,3vw,24px);
  background-image:radial-gradient(circle,#a7ad73 2px,transparent 2px);
  background-size:16px 8px;
  background-repeat:repeat-x;
}

.desc{
  margin:0 0 clamp(14px,4vw,28px);
  color:#3a3025;
  font-size:clamp(14px,3.8vw,22px);
  line-height:1.45;
  font-weight:800;
}

.buttons{
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
}

.btn{
  min-width:clamp(120px,34vw,170px);
  padding:clamp(10px,3vw,13px) clamp(12px,4vw,18px);
  border:2px solid #78983d;
  border-radius:999px;
  text-decoration:none;
  font-size:clamp(13px,3.5vw,17px);
  font-weight:900;
  box-shadow:0 5px 12px rgba(75,90,42,0.07);
  cursor:pointer;
}

.primary-btn{background:#78983d;color:#fff;}
.secondary-btn{background:#fffaf0;color:#78983d;}

/* =========================
   # 4. RECOMMEND SECTION
========================= */

#recommend{
  scroll-margin-top:var(--header-h);
}

#recommend,
body.recommend-page #recommend{
  display:block !important;
  min-height:calc(100svh - var(--header-h));
  padding-top:24px;
  scroll-margin-top:var(--header-h);
}

#recommend.is-hidden{
  display:block !important;
}

body.recommend-page .hero{
  display:flex !important;
}

body.recommend-page main{
  padding-top:0;
}

.recommend-section{
  padding:12px 18px 52px;
  background:var(--cream);
  border-top:1px solid rgba(223,199,161,0.55);
}

.recommend-header{
  max-width:720px;
  margin:0 auto 14px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  text-align:left;
}

.recommend-title-group{
  flex:1;
  min-width:0;
}

.recommend-title-group h2,
.recommend-header h2{
  margin:0;
  color:#314d35;
  font-size:clamp(32px,8vw,40px);
  line-height:0.98;
  font-weight:900;
  letter-spacing:-2px;
}

.back-home-btn,
.change-filter-btn{
  flex:0 0 auto;
  width:62px;
  height:62px;
  padding:0;
  border:1.5px solid #dfcfb4;
  border-radius:50%;
  background:#fffaf2;
  color:#5c5143;
  box-shadow:none;
  font-size:13px;
  line-height:1.2;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  cursor:pointer;
}

/* 추천 영역 빈 상태 */
.recommend-empty{
  width:100%;
  margin:10px 18px;
  padding:24px 18px;
  border:1.5px dashed #d9c9aa;
  border-radius:22px;
  background:#fffdf8;
  color:#6f5d43;
  font-size:15px;
  font-weight:800;
  line-height:1.5;
  text-align:center;
}

.game-scroll.is-empty{
  display:block !important;
  margin:0 auto !important;
  padding:0 !important;
  max-width:720px;
}

.game-scroll:has(.recommend-empty){
  display:block !important;
  padding:0 18px 18px !important;
  margin:0 -18px !important;
}

.game-scroll .recommend-empty{
  width:100%;
  margin:10px 0;
}

/* =========================
   # 5. RECOMMEND FILTER / MODAL
========================= */

.recommend-filter{
  max-width:720px;
  margin:0 auto 18px;
  padding:12px 14px;
  border:1.5px solid var(--line);
  border-radius:22px;
  background:var(--paper);
  box-shadow:none;
}

.recommend-filter-card,
.recommend-filter-card-v3{
  padding:12px 14px;
  border:1.5px solid #e2d4bb;
  border-radius:26px;
  background:#fffdf8;
}

.recommend-filter-main-title{
  margin:0 0 10px;
  color:#314d35;
  font-size:22px;
  line-height:1.15;
  font-weight:900;
  letter-spacing:-1.2px;
}

.recommend-step{
  padding:8px 0;
  border-top:1px dashed #e0d2ba;
}

.recommend-step:first-of-type{
  border-top:0;
}

.recommend-step-head{
  width:100%;
  border:0;
  background:transparent;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  cursor:pointer;
}

.recommend-step-head span{
  display:flex;
  align-items:center;
  gap:10px;
  color:#2f2a21;
  font-size:18px;
  font-weight:900;
}

.recommend-step-head span b{
  width:28px;
  height:28px;
  border-radius:50%;
  background:#486a3f;
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:15px;
}

.recommend-step-head strong{
  max-width:160px;
  padding:8px 12px;
  border:1px solid #e2d4bb;
  border-radius:999px;
  background:#f5efe4;
  color:#2e2a24;
  font-size:13px;
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.recommend-step-head strong.is-placeholder{
  color:#9a907f;
  background:#f8f4ec;
}

.recommend-step-head strong:not(.is-placeholder){
  background:#f5efe4 !important;
  border-color:#d8ccb7 !important;
  color:#4d463d !important;
}

.recommend-step-options{
  display:none;
  flex-wrap:wrap;
  gap:9px;
  padding-top:8px;
}

.recommend-step.is-open .recommend-step-options{
  display:flex;
}

.recommend-inline-option{
  min-height:40px;
  padding:8px 13px;
  border:1.5px solid rgba(216,194,157,0.75);
  border-radius:999px;
  background:#fffdf8;
  color:#3d3528;
  font-size:14px;
  font-weight:800;
  letter-spacing:-0.4px;
  cursor:pointer;
}

.recommend-inline-option.is-selected{
  background:#e7f1d8;
  border-color:#5f823f;
  color:#29432f;
}

.recommend-inline-option.is-none-option{
  background:#fffdf8;
  border-color:#d8ccb7;
  color:#4d463d;
  box-shadow:none;
}

.recommend-inline-option.is-none-option::before{
  content:"⊘";
  color:#7f9a67;
  margin-right:4px;
}

/* 구버전 추천 필터 표시용 선택자 유지 */
.recommend-filter-row,
.recommend-chip-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
}

.recommend-filter-item strong,
.recommend-filter-chip,
.recommend-chip{
  display:inline-flex;
  align-items:center;
  min-height:36px;
  padding:0 12px;
  border:1px solid #e3d5bb;
  border-radius:999px;
  background:#f5efe2;
  color:#38342d;
  font-size:13px;
  font-weight:700;
  line-height:1;
}

.filter-desc{
  margin:0;
  color:#574f43;
  font-size:13px;
  font-weight:700;
  line-height:1.52;
  letter-spacing:-0.2px;
}

.recommend-filter-mood{
  width:100%;
}

/* 추천 모달 */
.recommend-modal{
  position:fixed;
  top:var(--header-h);
  left:0;
  right:0;
  bottom:0;
  z-index:var(--overlay-z);
  display:none;
  align-items:flex-end !important;
  gap:18px !important;
  flex-direction:column !important;
  justify-content:flex-end !important;
  padding:clamp(8px,2.5svh,16px) 16px max(clamp(10px,2.5svh,18px),var(--safe-bottom)) !important;
}

.recommend-modal.is-active{
  display:flex;
}

.recommend-modal-dim{
  position:absolute;
  inset:0;
  background:rgba(30,25,18,0.45);
}

.recommend-modal-panel{
  position:relative;
  z-index:1;
  width:100% !important;
  max-width:420px !important;
  max-height:min(72svh, calc(100svh - var(--header-h) - 108px)) !important;
  margin:0 auto !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  padding:clamp(18px,5vw,22px);
  border:2px solid #d8c29d;
  border-radius:28px;
  background:linear-gradient(180deg,#fffaf2 0%,#fffdf8 100%);
  box-shadow:0 16px 40px rgba(40,30,16,0.22);
}

.recommend-modal-body{
  flex:1 1 auto !important;
  overflow-y:auto !important;
  -webkit-overflow-scrolling:touch !important;
  padding:0 0 132px !important;
}

.recommend-modal-header{
  display:flex;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:12px;
  margin-bottom:26px;
  padding-top:8px !important;
}

.recommend-modal-header h3{
  max-width:260px !important;
  margin:0;
  color:#3d5b3f;
  font-size:clamp(24px,6vw,30px);
  line-height:1.12 !important;
  font-weight:900;
  letter-spacing:-1px;
  text-align:left !important;
}

.modal-close-btn{
  flex:0 0 auto;
  width:36px;
  height:36px;
  border:1px solid #d8c29d;
  border-radius:50%;
  background:var(--paper);
  color:var(--ink);
  font-size:22px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.modal-filter-group{
  position:relative;
  margin-bottom:22px !important;
  padding-bottom:22px !important;
}

.modal-filter-group:not(:last-of-type)::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:0;
  width:70%;
  height:1px;
  transform:translateX(-50%);
  background:repeating-linear-gradient(to right,rgba(190,170,135,0.22) 0 6px,transparent 6px 12px);
}

.modal-filter-group:not(:last-of-type)::before{
  content:"🌱";
  position:absolute;
  left:50%;
  bottom:-12px !important;
  transform:translateX(-50%);
  padding:0 10px;
  background:#fffdf8;
  font-size:16px !important;
  line-height:1;
  opacity:0.9 !important;
}

.modal-filter-group p{
  display:flex;
  align-items:center;
  gap:12px;
  margin:0 0 16px;
  color:var(--ink);
  font-size:clamp(20px,5vw,22px);
  line-height:1.2;
  font-weight:800 !important;
  letter-spacing:-0.7px !important;
}

.modal-filter-group p::before{
  flex:0 0 auto;
  width:32px;
  height:32px;
  border-radius:50%;
  background:#486a3f;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  font-weight:900;
  box-shadow:0 2px 5px rgba(53,84,60,0.18) !important;
}

.modal-filter-group:nth-of-type(1) p::before{content:"1";}
.modal-filter-group:nth-of-type(2) p::before{content:"2";}
.modal-filter-group:nth-of-type(3) p::before{content:"3";}

.modal-option-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px 9px !important;
  justify-content:flex-start !important;
}

.modal-option{
  min-height:44px !important;
  padding:9px 14px !important;
  border:1.5px solid rgba(216,194,157,0.75);
  border-radius:999px;
  background:#fffdf8;
  color:#3d3528;
  font-size:14px !important;
  line-height:1.2;
  font-weight:800;
  letter-spacing:-0.4px !important;
  white-space:nowrap !important;
  box-shadow:0 3px 8px rgba(75,58,35,0.035);
  transition:background .16s ease,border-color .16s ease,color .16s ease,transform .12s ease,box-shadow .16s ease;
  cursor:pointer;
}

.modal-option:active{
  transform:scale(0.98);
}

.modal-option.is-selected{
  background:#e7f1d8 !important;
  border-color:#5f823f !important;
  color:#29432f !important;
  box-shadow:inset 0 0 0 1px rgba(79,116,69,0.08);
}

.modal-submit-btn{
  width:100% !important;
  max-width:420px !important;
  min-height:52px !important;
  margin:0 auto !important;
  padding:14px 18px;
  border:0;
  border-radius:999px;
  background:linear-gradient(90deg,#6f9448 0%,#5f823f 100%);
  color:#fff;
  font-size:17px;
  line-height:1.2;
  font-weight:900;
  letter-spacing:-0.6px;
  box-shadow:0 10px 24px rgba(70,90,42,0.18),0 4px 10px rgba(0,0,0,0.08);
  cursor:pointer;
  flex:0 0 auto !important;
  position:relative !important;
  z-index:5 !important;
}

.modal-submit-btn::before,
.modal-submit-btn::after{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  font-size:13px;
  opacity:0.32;
}

.modal-submit-btn::before{content:"🌿";left:18px;}
.modal-submit-btn::after{content:"🌿";right:18px;}

/* =========================
   # 6. GAME CARD / GAME SHEET
========================= */

.game-scroll{
  max-width:720px;
  display:flex;
  gap:10px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x proximity;
  scrollbar-width:none;
  padding:0 18px 18px;
  margin:-6 -18px;
}

.game-scroll::-webkit-scrollbar{
  display:none;
}

.game-card{
  flex:0 0 auto;
  width:138px;
  min-width:138px;
  min-height:auto;
  padding:10px;
  border:1.5px solid #ece1cf;
  border-radius:22px;
  background:var(--paper);
  box-shadow:none;
  text-align:left;
  scroll-snap-align:start;
  cursor:pointer;
}

.game-card.active{
  border-color:#cfd9bd;
  box-shadow:0 8px 18px rgba(79,116,69,0.10);
}

.game-card:first-child{margin-left:2px;}
.game-card:last-child{margin-right:18px;}

.game-card img{
  width:100%;
  aspect-ratio:1/1;
  height:auto;
  object-fit:contain;
  padding:4px;
  margin-bottom:5px;
  border:1px solid rgba(223,199,161,0.32);
  border-radius:14px;
  background:#f7f2e8;
  display:block;
}

.game-card strong{
  display:block;
  margin-bottom:7px;
  color:#2d2b26;
  font-size:16px;
  font-weight:800;
  line-height:1.16;
  letter-spacing:-0.5px;
}

.game-card-description{
  margin:0 0 8px;
  color:#6d6559;
  font-size:10px;
  line-height:1.38;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.game-meta{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin:0;
}

.game-meta span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  background:#f5efe4;
  color:#5c5447;
  font-size:9px;
  font-weight:700;
  white-space:nowrap;
}

.game-card em{
  display:none;
}

.recommend-cta{
  width:100%;
  max-width:720px;
  min-height:56px;
  margin:16px auto 0;
  padding:14px 18px;
  border:0;
  border-radius:999px;
  background:#5f823f;
  color:#fff;
  font-size:18px;
  font-weight:900;
  letter-spacing:-0.5px;
  box-shadow:0 6px 18px rgba(61,91,63,0.14);
  cursor:pointer;
}

/* 상세 바텀시트 */
.game-sheet{
  position:fixed;
  inset:0;
  z-index:var(--sheet-z);
  display:none;
  width:100%;
  height:100%;
}

.game-sheet.is-active{
  display:block;
}

.game-sheet-dim{
  position:absolute;
  inset:0;
  background:rgba(20,18,14,0.5);
  backdrop-filter:blur(2px);
}

.game-sheet-panel{
  position:absolute;
  left:0;
  right:0;
  top:72px;
  bottom:0;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding:22px 20px 120px;
  border-radius:28px 28px 0 0;
  background:var(--paper-2);
  box-shadow:0 -10px 30px rgba(0,0,0,0.16);
  animation:sheetUp .22s ease;
}

body.sheet-open{
  overflow:hidden;
}

#gameSheetContent{
  padding-bottom:120px;
}

@keyframes sheetUp{
  from{transform:translateY(100%);}
  to{transform:translateY(0);}
}

.game-sheet-close{
  position:absolute;
  top:14px;
  right:14px;
  width:38px;
  height:38px;
  border:0;
  border-radius:50%;
  background:#f1e7d4;
  font-size:18px;
  cursor:pointer;
}

.sheet-image img{
  width:100%;
  aspect-ratio:1/1;
  max-height:190px;
  object-fit:contain;
  padding:14px;
  border-radius:20px;
  background:#f5eee2;
}

.sheet-content{
  margin-top:20px;
}

.level-badge{
  display:inline-block;
  margin-top:18px;
  padding:7px 14px;
  border-radius:999px;
  background:#edf3df;
  color:#2f5d50;
  font-size:15px;
  font-weight:900;
}

.sheet-content h3{
  margin:14px 0 10px;
  color:#2f5d50;
  font-size:30px;
  line-height:1.15;
}

.sheet-description{
  margin:0;
  color:#3a3025;
  font-size:18px;
  line-height:1.65;
  font-weight:700;
}

.sheet-info-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin:22px 0;
  padding:10px;
  border:1.5px solid #ead8b8;
  border-radius:22px;
  background:var(--cream);
}

.sheet-info-grid div{
  padding:14px 10px;
  border-radius:16px;
  background:var(--paper);
  text-align:center;
  box-shadow:0 2px 8px rgba(70,50,20,0.04);
}

.sheet-info-grid strong{
  display:block;
  margin-bottom:5px;
  color:#2f5d50;
  font-size:18px;
  line-height:1.2;
}

.sheet-info-grid span{
  color:var(--muted);
  font-size:13px;
  font-weight:900;
}

.player-sub-info,
.difficulty-sub-info{
  display:block;
  margin-top:3px;
  color:#8d8478;
  font-size:12px;
  font-style:normal;
  font-weight:700;
  line-height:1.25;
}

.sheet-section{
  margin-top:18px;
  padding:18px;
  border:1.5px solid #ead8b8;
  border-radius:20px;
  background:var(--paper);
}

.sheet-section h4{
  margin:0 0 10px;
  color:#2f5d50;
  font-size:20px;
  display:flex;
  align-items:center;
  gap:8px;
}

.sheet-section p{
  margin:0;
  color:#3a3025;
  font-size:17px;
  line-height:1.65;
  font-weight:700;
}

.sheet-youtube-link,
.sheet-action-btn{
  display:block;
  margin-top:18px;
  padding:15px 18px;
  border-radius:999px;
  background:var(--green-3);
  color:#fff;
  text-align:center;
  text-decoration:none;
  font-size:17px;
  font-weight:900;
}

.sheet-action-btn{
  width:100%;
  margin-top:0;
  background:#5f823f;
}

.sheet-data-section{
  margin-top:14px;
}

.sheet-data-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.sheet-data-list > div{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius:14px;
  background:#fffaf0;
  border:1px solid #ead8b8;
}

.sheet-data-list span{
  font-size:12px;
  color:#8b7459;
  white-space:nowrap;
}

.sheet-data-list strong{
  font-size:13px;
  color:#3f3328;
  text-align:right;
  line-height:1.35;
}

/* =========================
   # 7. OWNED GAMES PAGE
========================= */

.owned-games-page{
  min-height:100svh;
  padding:calc(var(--header-h) + 28px) 18px 60px;
  background:var(--bg);
}

.owned-games-page h1{
  max-width:720px;
  margin:0 auto 14px !important;
  color:#314d35;
  font-size:32px;
  font-weight:900;
  letter-spacing:-1.2px;
}

#ownedGameList{
  max-width:720px;
  margin:0 auto !important;
  display:flex;
  flex-direction:column;
  gap:8px !important;
}

/* 전체게임보기 빈 결과 상자: JS의 .owned-empty와 연결됨 */
.owned-empty{
  width:100%;
  margin:10px 0;
  padding:24px 18px;
  border:1.5px dashed #d9c9aa;
  border-radius:22px;
  background:#fffdf8;
  color:#6f5d43;
  font-size:15px;
  font-weight:800;
  line-height:1.5;
  text-align:center;
}

.owned-game-item{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px !important;
  padding:10px 11px !important;
  border:1.5px solid #e5d7bd;
  border-radius:18px !important;
  background:#fffdf8 !important;
  box-shadow:0 3px 10px rgba(70,50,20,0.035) !important;
  text-align:left;
  cursor:pointer;
}

.owned-game-item img{
  width:56px !important;
  height:56px !important;
  flex:0 0 56px !important;
  object-fit:contain;
  border-radius:14px;
  background:#f7f2e8;
  border:1px solid rgba(223,199,161,0.35);
}

.owned-game-info{
  min-width:0;
}

.owned-game-info strong{
  display:block;
  margin-bottom:5px !important;
  color:#2f2a21;
  font-size:16px !important;
  line-height:1.15 !important;
  font-weight:900;
}

.owned-game-info p{
  margin:0;
  color:#6f5d43;
  font-size:13px;
  font-weight:800;
  line-height:1.4;
}

.owned-game-meta{
  display:flex;
  flex-wrap:wrap;
  gap:4px !important;
  margin-top:6px !important;
  font-size:12px;
}

.owned-game-meta span{
  display:inline-flex;
  align-items:center;
  min-height:22px !important;
  padding:3px 7px !important;
  border:1px solid rgba(95,78,45,0.16);
  border-radius:999px;
  background:#fffdf6;
  color:#4c3b24;
  font-size:11.5px !important;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
}

.owned-game-meta .difficulty-kids{background:#fff7df;}
.owned-game-meta .difficulty-beginner{background:#eef8df;}
.owned-game-meta .difficulty-light{background:#f5efe2;}
.owned-game-meta .difficulty-heavy{background:#edf3f0;}
.owned-game-meta .difficulty-hardcore{background:#f5e7df;}

.owned-pagination{
  max-width:720px;
  margin:14px auto 0 !important;
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px;
}

.owned-pagination button{
  min-width:38px;
  height:38px;
  padding:0 12px;
  border:1.5px solid #dfc7a1;
  border-radius:999px;
  background:#fffdf8;
  color:#314d35;
  font-size:14px;
  font-weight:900;
}

.owned-pagination button.is-active{
  background:#5f823f;
  border-color:#5f823f;
  color:#fff;
}

.owned-pagination button:disabled{
  opacity:0.35;
}

/* =========================
   # 8. OWNED SEARCH + SORT/FILTER TOOLBAR
========================= */

/* 검색창 + 정렬필터 버튼 한 줄 */
.owned-search-row{
  max-width:720px !important;
  margin:0 auto 10px !important;
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
}

.owned-search-row .owned-search-box{
  flex:1 1 auto !important;
  min-width:0 !important;
  margin:0 !important;
}

.owned-search-box{
  max-width:720px !important;
  position:relative !important;
}

.owned-search-box::before{
  content:none !important;
}

.owned-search-box::after{
  content:"🔍" !important;
  position:absolute !important;
  left:14px !important;
  top:50% !important;
  bottom:auto !important;
  transform:translateY(-50%) !important;
  font-size:15px !important;
  opacity:0.7 !important;
  pointer-events:none !important;
}

.owned-search-box input{
  width:100% !important;
  height:40px !important;
  padding:0 14px 0 38px !important;
  border:1.5px solid #dfc7a1 !important;
  border-radius:999px !important;
  background:#fffdf8 !important;
  color:#314d35;
  font-size:14px !important;
  font-weight:800 !important;
  box-shadow:0 3px 8px rgba(70,50,20,0.035) !important;
  -webkit-user-select:text !important;
  user-select:text !important;
  -webkit-touch-callout:default !important;
  pointer-events:auto !important;
}

/* 정렬·필터 열기/접기 버튼 */
.owned-tools-toggle{
  width:auto !important;
  max-width:none !important;
  min-width:92px !important;
  height:42px !important;
  flex:0 0 auto !important;
  margin:0 !important;
  padding:0 12px !important;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1.5px solid #dfc7a1 !important;
  border-radius:999px;
  background:#fffaf0 !important;
  color:#5f553f !important;
  box-shadow:none !important;
  font-size:13px;
  font-weight:900;
  white-space:nowrap;
  cursor:pointer;
}

.owned-tools-toggle.is-hidden{
  display:none !important;
}

.owned-tools-close{
  width:100%;
  min-height:34px;
  border:0;
  border-radius:999px;
  background:#f5efe4;
  color:#5f553f;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

/* 정렬/필터 접힘 영역 */
.owned-toolbar{
  max-width:720px !important;
  margin:0 auto 8px !important;
  padding:0 !important;
  display:block !important;
  overflow:hidden;
  transition:max-height .22s ease,opacity .16s ease,margin .16s ease;
}

.owned-toolbar.is-collapsed{
  max-height:0 !important;
  opacity:0 !important;
  pointer-events:none !important;
  margin-bottom:0 !important;
}

/* 튜닝 포인트: 정렬/필터 전체 상자 */
.owned-sort-grid{
  width:100%;
  display:grid;
  grid-template-columns:1fr;
  gap:7px !important;
  padding:9px 6px !important;
  border:1.5px solid #e5d7bd;
  border-radius:18px !important;
  background:#fffdf8 !important;
  box-shadow:none !important;
}

/* 튜닝 포인트: 정렬 한 줄 */
.owned-sort-line{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin:0;
  padding:0 !important;
}

/* 튜닝 포인트: 정렬 제목 */
.owned-sort-title{
  flex:0 0 auto;
  color:#314d35;
  font-size:14px;
  font-weight:900;
  white-space:nowrap;
}

/* 정렬 버튼 3개 묶음 */
.owned-sort-compact{
  display:flex !important;
  align-items:center;
  gap:8px;
}

/* 실제 select는 투명 처리, label이 보이는 버튼 역할 */
.sort-select-wrap{
  position:relative;
  display:inline-flex !important;
  min-width:65px;
  max-width:74px;
  height:20px;
}

/* 튜닝 포인트: 이름/난이도/평점 보이는 버튼 */
.sort-select-label{
  width:100%;
  height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 4px;
  border:1px solid #dccdb3;
  border-radius:999px;
  background:#fffdf8;
  color:#4f463c;
  font-size:11px;
  font-weight:700;
  line-height:1;
  white-space:nowrap;
  pointer-events:none;
}

.sort-select-wrap select{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  display:block !important;
  pointer-events:auto !important;
  cursor:pointer;
}

/* 구버전 select 스타일 유지: 혹시 다른 페이지/마크업에서 쓰면 깨지지 않게 */
.owned-toolbar select,
.owned-sort-compact select{
  color:#4f463c;
  background:#fffdf8;
}

/* 점선 divider */
.owned-control-divider{
  height:1px;
  margin:1px 0 !important;
  background:repeating-linear-gradient(to right,rgba(190,170,135,0.35) 0 6px,transparent 6px 12px);
}

/* 튜닝 포인트: 필터 한 줄 */
.owned-filter-line{
  display:flex !important;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding-top:0;
}

/* 튜닝 포인트: 필터 제목 */
.owned-filter-title{
  flex:0 0 auto;
  color:#314d35;
  font-size:14px;
  font-weight:900;
  white-space:nowrap;
}

/* 튜닝 포인트: 체감난이도 / 게임유형 select */
.owned-filter-line select{
  display:block !important;
  flex:0 1 auto;
  min-width:92px;
  max-width:108px;
  height:22px;
  padding:0 8px;
  border:1px solid #dccdb3;
  border-radius:999px;
  background:#fffdf8;
  color:#4f463c;
  font-size:11px;
  font-weight:700;
  text-align:left;
  text-align-last:auto;
}

/* 예전 accordion/pill 필터 구조는 현재 compact select 구조에서는 숨김 유지 */
.owned-accordion-head,
.owned-accordion-body,
.owned-filter-block,
.owned-pill-row,
.owned-pill{
  display:none !important;
}

/* 구버전 클래스 보존: JS/HTML이 남아 있어도 기본 스타일은 안전하게 유지 */
.owned-control-title,
.owned-sort-item,
.owned-filter-label,
.owned-sort-label,
.owned-sort-btn,
.owned-filter-chip,
.owned-games-grid,
.owned-game-card,
.owned-game-thumb,
.owned-game-title,
.owned-game-tags,
.owned-game-tag{
  /* legacy selector placeholder */
}

/* =========================
   # 9. RESPONSIVE
========================= */

@media(max-width:320px){
  .header-center{
    display:none;
  }

  .site-header{
    grid-template-columns:1fr auto;
  }
}

@media(max-width:380px){
  .recommend-modal-panel{
    padding:18px;
  }

  .modal-option{
    padding:9px 12px !important;
    font-size:13.5px !important;
  }

  .game-card{
    width:158px;
    min-width:158px;
  }
}

@media(max-width:600px){
  .hero{
    align-items:center;
  }

  .deco-1{left:2%;top:16%;}
  .deco-2{right:6%;top:12%;}
  .deco-3{left:6%;bottom:7%;}
}

@media(min-width:720px){
  .game-scroll{
    margin:0 auto;
    padding-left:2px;
    padding-right:2px;
  }

  .game-card{
    width:190px;
    min-width:190px;
    padding:12px;
  }

  .game-card strong{
    font-size:18px;
  }

  .game-card-description{
    font-size:12px;
  }

  .game-meta span{
    height:24px;
    font-size:10px;
  }
}

@media(min-width:900px){
  .site-header{
    grid-template-columns:clamp(82px,12vw,130px) 1fr auto;
  }

  .header-menu{
    position:static;
    width:auto;
    display:flex;
    flex-direction:row;
    align-items:center;
    justify-content:flex-end;
    gap:28px;
    padding:0;
    border:0;
    background:transparent;
    box-shadow:none;
  }

  .header-menu a{
    width:auto;
    padding:0;
    white-space:nowrap;
    font-size:16px;
  }

  .menu-toggle{
    display:none;
  }

  .hero{
    padding-top:calc(var(--header-h) + 60px);
  }

  .hero-inner{
    flex-direction:row;
    justify-content:center;
    gap:80px;
  }

  .hero-visual{
    max-width:480px;
  }

  .hero-text{
    flex:1;
  }

  .hero h1{
    line-height:1.28;
  }

  .desc{
    line-height:1.6;
  }
}


