@font-face { font-family: 'Patrick Hand'; src: url('fonts/PatrickHand-latin.woff2') format('woff2'); font-display: swap; }
:root { --ink: #3a2a22; --paper: #fff6e6; --edge: #e9d7bd; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #6fcdf0; font-family: 'Patrick Hand', 'Comic Sans MS', system-ui, sans-serif; color: var(--ink); }
canvas#c { display: block; touch-action: none; cursor: grab; }
canvas#c:active { cursor: grabbing; }
button { font: inherit; color: inherit; cursor: pointer; }

#top { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 0; pointer-events: none; }
#title, #plans { pointer-events: auto; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 rgba(58,42,34,.25); }
#title { padding: 5px 12px 6px; line-height: 1.05; }
#title b { display: block; font-size: 19px; font-weight: 400; }
#title span { font-size: 15px; opacity: .7; }
#plans { padding: 7px 14px; font-size: 16px; max-width: 58vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#plans:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(58,42,34,.25); }

#card { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); width: min(340px, calc(100vw - 24px)); transform: translate(-50%, 16px); opacity: 0; transition: transform .2s, opacity .2s;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 20px; padding: 14px 16px 12px; box-shadow: 0 6px 0 rgba(58,42,34,.22); max-height: 70vh; overflow: auto; }
#card.on { transform: translate(-50%, 0); opacity: 1; }
#cardPic { display: block; width: 100%; max-width: 200px; height: auto; margin: 0 auto 6px; border: 2px solid var(--ink); border-radius: 14px; }
#card h2 { margin: 0 0 4px; font-size: 26px; font-weight: 400; text-align: center; }
#card h3 { margin: 12px 0 4px; font-size: 18px; font-weight: 400; }
#card p { margin: 4px 0; font-size: 17px; line-height: 1.25; }
#card .now { color: #8a4a2a; }
#card .small { font-size: 15px; opacity: .8; }
.bat, .row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 15px; }
.bat span { opacity: .7; width: 50px; }
.row span { flex: 1; }
.bat i, .row i { flex: 1; height: 10px; border: 1.8px solid var(--ink); border-radius: 8px; overflow: hidden; background: #fff; }
.row i { flex: 0 0 40%; }
.bat b, .row b { display: block; height: 100%; background: #7ccf8a; }
.ev { list-style: none; margin: 0; padding: 0; font-size: 15px; line-height: 1.25; }
.ev li { padding: 4px 0; border-top: 1.5px dashed var(--edge); }
.ev span { display: block; font-size: 13px; opacity: .55; }
.btns { display: flex; justify-content: flex-end; margin-top: 8px; }
.btns button { background: #f2c14e; border: 2px solid var(--ink); border-radius: 12px; padding: 3px 18px; font-size: 18px; box-shadow: 0 3px 0 rgba(58,42,34,.25); }

#toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 10px); max-width: min(520px, calc(100vw - 24px)); background: rgba(255,246,230,.94); border: 2px solid var(--ink); border-radius: 14px; padding: 6px 14px; font-size: 17px; text-align: center; opacity: 0; transition: opacity .5s, transform .5s; pointer-events: none; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#card:not([hidden]) ~ #toast { opacity: 0; }
