* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%; overflow: hidden; overscroll-behavior: none;
  background: #241811; color: #f2e4cc;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
#wrap { position: fixed; inset: 0; width: 100%; height: 100%; display: flex; flex-direction: column; }
.hidden { display: none !important; }

#hud {
  padding: calc(8px + env(safe-area-inset-top)) 14px 6px;
  display: flex; justify-content: space-between; align-items: center;
  background: #1a100a; border-bottom: 3px solid #5a3a24;
  font-weight: 700; font-size: 13.5px;
}
#dust-box { color: #e8c060; }

section { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 16px; }

.pick-label { font-size: 14px; font-weight: 800; color: #c9a878; margin: 12px 0 8px; align-self: flex-start; }
.pick-row { display: flex; gap: 8px; width: 100%; }
.pick-btn {
  flex: 1; min-height: 86px; border-radius: 14px; border: 3px solid #5a3a24;
  background: #33221666; color: #f2e4cc; font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 4px;
}
.pick-btn .swatch { width: 30px; height: 30px; border-radius: 50%; margin-bottom: 6px; border: 2px solid rgba(255,255,255,.3); }
.pick-btn .pname { font-size: 13px; font-weight: 800; }
.pick-btn .psub { font-size: 10.5px; color: #c9a878; margin-top: 2px; }
.pick-btn.sel { border-color: #e8c060; background: #4a3020; box-shadow: 0 0 12px rgba(232,192,96,.4); }
#btn-fire { margin-top: 22px; }

#fire-timer { font-size: 40px; font-weight: 900; color: #ffb347; font-variant-numeric: tabular-nums; }
#gauge-wrap {
  width: min(84vw, 340px); height: 34px; border-radius: 17px; margin: 18px 0;
  background: linear-gradient(90deg, #3a2517, #6b3a1a, #b85c1e, #e88b2e, #b85c1e, #6b3a1a, #3a2517);
  border: 3px solid #5a3a24; position: relative; overflow: hidden;
}
#gauge-zone {
  position: absolute; top: 0; bottom: 0; left: 62%; width: 20%;
  background: rgba(255,230,140,.5); border-left: 2px solid #ffe68c; border-right: 2px solid #ffe68c;
}
#gauge-needle {
  position: absolute; top: -4px; bottom: -4px; width: 8px; margin-left: -4px;
  background: #fff; border-radius: 4px; box-shadow: 0 0 10px #fff;
}
#hold-hint { font-size: 14px; color: #c9a878; text-align: center; line-height: 1.5; }
#kiln-fire { font-size: 90px; margin-top: 16px; filter: drop-shadow(0 0 24px rgba(255,120,30,.6)); }
#phase-fire.holding #kiln-fire { animation: blaze .3s ease-in-out infinite alternate; }
@keyframes blaze { from { transform: scale(1); filter: drop-shadow(0 0 18px rgba(255,120,30,.5)); } to { transform: scale(1.06); filter: drop-shadow(0 0 34px rgba(255,140,40,.85)); } }

#door-hint { font-size: 15px; color: #c9a878; margin-bottom: 14px; animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateX(6px); } }
#kiln-door {
  width: min(70vw, 280px); height: min(70vw, 280px); border-radius: 20px;
  background: radial-gradient(circle at 50% 30%, #6b3a1a, #33200f);
  border: 6px solid #5a3a24; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 40px rgba(0,0,0,.6), 0 10px 30px rgba(0,0,0,.5);
}
#door-panel { font-size: 110px; transition: transform .4s ease-in, opacity .4s; }
#kiln-door.open #door-panel { transform: translateX(120%) rotate(10deg); opacity: 0; }
#kiln-door.open { background: radial-gradient(circle at 50% 45%, #ffd890, #e88b2e 55%, #33200f); }

.overlay {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(26,16,10,.96);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.title-kr { font-size: 52px; font-weight: 900; color: #ffb347; text-shadow: 0 3px 0 rgba(0,0,0,.5); margin-bottom: 8px; }
.title-sub { font-size: 14px; color: #c9a878; margin-bottom: 14px; }
.best-line { font-size: 13px; color: #e8c060; font-weight: 700; margin-bottom: 12px; }
.howto { margin-bottom: 22px; display: flex; flex-direction: column; gap: 10px; }
.how-row { display: flex; align-items: center; gap: 11px; text-align: left; font-size: 13px; line-height: 1.4; max-width: 310px; }
.how-ico { font-size: 22px; flex-shrink: 0; width: 32px; text-align: center; }
.big-btn {
  min-width: 190px; min-height: 54px; padding: 13px 30px;
  font-size: 19px; font-weight: 800; font-family: inherit;
  color: #2a1a08; background: linear-gradient(180deg, #ffcf6e, #e8963e);
  border: none; border-radius: 12px; cursor: pointer;
  box-shadow: 0 4px 0 #a06620;
}
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a06620; }

#pot-figure { position: relative; width: 200px; height: 200px; display: flex; align-items: center; justify-content: center; }
#pot-body { font-size: 120px; z-index: 2; animation: potIn .6s cubic-bezier(.2,1.4,.4,1); filter: drop-shadow(0 10px 24px rgba(0,0,0,.6)); }
@keyframes potIn { from { transform: scale(.3) translateY(60px); opacity: 0; } }
#pot-beam {
  position: absolute; inset: -45%; display: none;
  background: conic-gradient(transparent, rgba(255,225,150,.85), transparent 28%);
  animation: spin 2.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#pot-figure.t3 #pot-beam, #pot-figure.t4 #pot-beam { display: block; }
#pot-tier { font-size: 30px; font-weight: 900; margin-top: 10px; }
#pot-name { font-size: 15px; color: #c9a878; margin-top: 4px; }
#pot-rep { font-size: 16px; font-weight: 800; color: #e8c060; margin: 12px 0 18px; }

.float-num {
  position: absolute; font-weight: 900; font-size: 18px; color: #ffcf6e;
  pointer-events: none; animation: floatUp 1s ease-out forwards; z-index: 20;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
}
@keyframes floatUp { to { transform: translateY(-70px); opacity: 0; } }

.icon-btn {
  position: absolute; bottom: calc(12px + env(safe-area-inset-bottom)); right: 12px; z-index: 12;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 2px solid #5a3a24; color: #f2e4cc; font-size: 19px; cursor: pointer;
}
