body{min-height:100vh;background:#ffbd24 url('/tatari-companion/assets/background02.webp') center top/cover fixed;color:#232838}.navbar,.navbar summary,.navbar a{color:white}.hunt-layout{max-width:600px;margin:40px auto 70px;padding:0 16px;text-align:center}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}button,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:default}.stage-picker{display:flex;align-items:center;justify-content:center;gap:18px}.stage-picker>button{border:0;background:none;padding:4px}.stage-picker img{width:26px;height:28px;object-fit:contain}.stage-picker #next img{transform:rotate(180deg)}.stage-picker label{background:#fffef1;border:3px solid #151515;border-radius:15px;padding:8px 25px;font-size:20px;font-weight:800}.stage-picker select{border:0;background:transparent;font-weight:800;font-size:20px}.set-label{display:block;font-size:12px;margin:12px auto;max-width:450px}.set-label select{max-width:100%;display:block;width:100%;background:#fffef1;border:2px solid #2a2520;border-radius:8px;padding:6px;font-size:12px}.board-frame{position:relative;width:min(100%,460px);aspect-ratio:655/666;margin:auto;background:url('treasure-data/ground.webp') center/100% 100% no-repeat}.hunt-board{position:absolute;width:76%;height:76%;left:12%;top:12%;display:grid;grid-template-columns:repeat(var(--n),1fr);grid-template-rows:repeat(var(--n),1fr)}.tile{position:relative;border:0;padding:0;background:url('treasure-data/tile.png') center/100% 100% no-repeat;min-width:0;min-height:0}.tile{background:none;isolation:isolate}.tile::before{content:'';position:absolute;left:0;top:0;width:calc(100% + 5px);height:calc(100% + 10px);background:url('treasure-data/tile.png') center/100% 100% no-repeat;pointer-events:none;z-index:-1}.tile.empty::before{display:none}.tile:focus-visible{outline:3px solid white;z-index:5}.mark{position:absolute;width:55%;height:55%;object-fit:contain;left:22.5%;top:22.5%;z-index:3}.recommend{position:absolute;inset:8% 0 5%;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:3}.recommend img{width:45%;height:48%;object-fit:contain}.recommend strong{font-size:clamp(11px,2.6vw,18px);line-height:1;color:white;text-shadow:2px 2px #000,-2px -2px #000,2px -2px #000,-2px 2px #000}.placed{position:absolute;pointer-events:none;object-fit:fill;z-index:2}.hunt-actions{display:flex;justify-content:center;gap:12px;margin:14px}.hunt-actions button{display:flex;align-items:center;gap:5px;background:#fffef1;border:3px solid #161616;border-radius:14px;padding:8px 14px;font-weight:800;font-size:20px;box-shadow:0 5px #72551c}.hunt-actions #clear{background:#ffbd23;border-color:#673800}.hunt-actions img{width:28px;height:28px;object-fit:contain}#status,.help,.model-note{font-size:12px;line-height:1.6}.model-note{opacity:.8}.retry{border:0;background:none;text-decoration:underline;font-size:12px}dialog{background:#fffef1;border:3px solid #211d18;border-radius:16px;width:min(90vw,520px);max-height:85vh;overflow:auto;padding:22px}dialog::backdrop{background:#0008}.close{float:right;font-size:28px;border:0;background:#ffd344;border-radius:8px}.tile-options{display:flex;gap:10px}dialog button{color:#232838;border:2px solid #6d6b68;border-radius:8px;background:#ffda60;padding:8px}#treasures{display:flex;flex-wrap:wrap;gap:8px}#treasures button{width:110px;display:flex;flex-direction:column;align-items:center;font-size:12px}#treasures img{width:75px;height:85px;object-fit:contain}#parts{display:grid;gap:1px;width:220px;margin:14px auto}#parts button{aspect-ratio:1;padding:0;position:relative;overflow:hidden;border:2px solid #353138;border-radius:0;background-color:#64c8df}#placement-note{font-size:12px}@media(max-width:480px){.hunt-layout{margin-top:24px}.hunt-actions button{font-size:16px}.set-label{font-size:11px}}
/* Treasure tray and compact part picker. */
.hunt-layout{max-width:510px;margin-top:35px}.board-frame{width:min(100%,400px)}
.treasure-combination{display:flex;align-items:center;justify-content:center;gap:8px;margin:22px auto 8px;max-width:370px}
.treasure-combination>button{padding:0;border:0;background:none;flex:0 0 20px}.treasure-combination>button img{width:18px;height:23px;object-fit:contain}#set-next img{transform:rotate(180deg)}
#treasure-tray{display:flex;align-items:center;justify-content:center;gap:10px;flex:1;min-width:0;min-height:76px;background:#282625;border:3px solid #111;border-radius:17px;padding:10px;flex-wrap:wrap}#treasure-tray img{object-fit:contain;filter:grayscale(1)}#treasure-tray img.found{filter:none}
#tile-dialog{box-sizing:border-box;width:330px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 30px);padding:18px 20px 26px;border:3px solid #151515;border-radius:16px;text-align:center;overflow:auto;color:#111;font-family:Critters,system-ui,sans-serif}
#tile-dialog h2{font-size:18px;margin:0 20px 15px;line-height:1.4}#close-dialog{position:absolute;right:9px;top:11px;min-height:0;width:30px;height:33px;padding:0;border:0;background:transparent url('treasure-data/close-bg.png') center/contain no-repeat;border-radius:0}#close-dialog img{width:18px;height:18px;object-fit:contain}
.treasure-options,#treasures{display:flex;justify-content:center;align-items:stretch;gap:5px;flex-wrap:wrap}#treasures{display:contents}
#tile-dialog .treasure-choice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;width:76px;height:96px;min-height:0;box-sizing:border-box;border:1px solid transparent;border-radius:14px;background:#ddd;color:#111;padding:8px 3px;font-size:9px}
#tile-dialog .treasure-choice img{object-fit:contain;max-width:64px;max-height:68px}#tile-dialog #mark-empty img{width:44px;height:44px}#tile-dialog .treasure-choice[aria-pressed=true]{border-color:#ff9c00;background:#fff0ca}#tile-dialog .treasure-choice:disabled{opacity:.45}
#placement-note{font-size:10px;line-height:1.3;margin:12px 0 0}#placement{margin-top:0}.parts-wrap{position:relative;display:flex;align-items:center;justify-content:center;min-height:120px;padding:12px 28px;box-sizing:border-box}
#parts{--part-size:38px;display:grid;gap:0;width:max-content;margin:0 auto}#tile-dialog #parts button{width:var(--part-size);height:var(--part-size);aspect-ratio:1;min-height:0;padding:0;border:1px solid #ccc;border-radius:0;background:#fffef1;position:relative;overflow:hidden}
#tile-dialog #parts button:hover,#tile-dialog #parts button:focus-visible{background:#ffdb85;border-color:#ff9600;outline:none}#parts img{pointer-events:none;max-width:none}
#tile-dialog #rotate{position:absolute;left:calc(50% + var(--parts-half,38px) + 7px);top:50%;transform:translateY(-50%);width:28px;height:28px;min-height:0;padding:0;border:0;background:transparent}#rotate img{width:26px;height:26px;object-fit:contain}
#tile-dialog #mark-unknown{min-height:0;margin:22px auto 0;padding:5px 12px;border:2px solid #e18700;border-radius:9px;background:#ffcd35;font-size:12px;font-weight:bold;color:#111}
@media(max-width:420px){.hunt-layout{margin-top:24px}.treasure-combination{margin-top:16px}#tile-dialog{padding-left:15px;padding-right:15px}}

/* Explicit control colors prevent mobile browsers' default blue text. */
.hunt-layout button,.hunt-layout select{color:#111;-webkit-text-fill-color:#111}
.hunt-layout button{-webkit-appearance:none;appearance:none}

.hunt-layout .recommend strong{color:#fff;-webkit-text-fill-color:#fff}

/* Keep percentage digits crisp at desktop and mobile sizes. */
.hunt-layout .recommend strong{font-family:Arial,Helvetica,sans-serif;font-weight:800;font-style:normal;color:#fff;-webkit-text-fill-color:#fff;text-shadow:none;-webkit-text-stroke:1px #111;paint-order:stroke fill;line-height:1.15;letter-spacing:0}

.tile::before{background-image:var(--tile-art,url("treasure-data/tile.png"))}

.hunt-layout .recommend strong{color:#111;-webkit-text-fill-color:#111;-webkit-text-stroke:0;text-shadow:none}
/* Keep the arrows visually compact while giving them a comfortable hit area. */
.treasure-combination>button{flex-basis:44px;min-width:44px;min-height:44px;display:grid;place-items:center}
