:root { color-scheme: dark; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #090909; color: #fff; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.camera-app { position: relative; width: 100vw; height: 100dvh; min-height: 420px; display: flex; flex-direction: column; background: #090909; overflow: hidden; }
.topbar { height: calc(62px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 19px 0; flex: none; display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 5; }
.mode-title { font-size: 12px; letter-spacing: .23em; font-weight: 650; color: #e5e5e5; margin-left: -2px; }
.icon-button { width: 42px; height: 42px; border: 0; color: #fff; background: transparent; display: grid; place-items: center; }
.back-icon { display: block; width: 10px; height: 10px; border-left: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); }
.flip-icon { font-size: 27px; font-weight: 200; line-height: 1; }
.secret-trigger { position: absolute; left: 0; top: 0; width: 50px; height: calc(54px + env(safe-area-inset-top)); opacity: 0; border: 0; z-index: 6; }
.viewfinder { min-height: 0; flex: 1; position: relative; background: #171717; overflow: hidden; display: grid; place-items: center; }
.viewfinder video, .viewfinder img { display: block; height: 100%; width: 100%; object-fit: cover; }
.empty-camera { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; color: #ddd; background: radial-gradient(circle at 50% 42%, #262626, #101010 75%); text-align: center; }
.empty-camera p { margin: 0; font-size: 15px; }
.camera-glyph { font-size: 64px; line-height: 1; color: #666; }
.secondary-button, .primary-button { border: 1px solid #777; border-radius: 100px; color: #fff; background: #282828; padding: 12px 22px; font-size: 14px; font-weight: 600; }
.primary-button { background: #f2f2f2; color: #161616; border-color: #f2f2f2; }
.controls { flex: none; min-height: calc(152px + env(safe-area-inset-bottom)); padding: 26px 26px calc(36px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; background: #090909; }
.shutter { height: 76px; width: 76px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px; display: grid; place-items: center; }
.shutter span { width: 100%; height: 100%; border-radius: 50%; background: #fff; }
.shutter:active span { transform: scale(.88); }
.shutter:disabled { opacity: .45; }
.thumb-button { height: 48px; width: 48px; border: 1px solid #454545; border-radius: 11px; background: #202020; background-size: cover; background-position: center; }
.small-button { height: 48px; width: 48px; border: none; background: transparent; color: #eee; font-size: 29px; }
.review-controls { flex: none; min-height: calc(152px + env(safe-area-inset-bottom)); padding: 27px 18px calc(36px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-controls button { background: transparent; border: 0; color: #fff; font-size: 14px; font-weight: 600; padding: 12px 4px; }
.review-controls .save-button { background: #fff; color: #121212; border-radius: 24px; padding: 13px 16px; }
.processing { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,.79); text-align: center; }
.processing p { margin: 19px 0 5px; font-size: 17px; }
.processing small { color: #999; font-size: 12px; }
.spinner { width: 35px; height: 35px; border: 3px solid #666; border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.grid-lines { position: absolute; inset: 0; pointer-events: none; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.grid-lines i { border-color: #ffffff4d; border-style: solid; border-width: 0; }
.grid-lines i:nth-child(1), .grid-lines i:nth-child(2) { border-right-width: 1px; grid-row: 1/4; }
.grid-lines i:nth-child(1) { grid-column: 1; } .grid-lines i:nth-child(2) { grid-column: 2; }
.grid-lines i:nth-child(3), .grid-lines i:nth-child(4) { border-bottom-width: 1px; grid-column: 1/4; }
.grid-lines i:nth-child(3) { grid-row: 1; } .grid-lines i:nth-child(4) { grid-row: 2; }
.toast { position: absolute; z-index: 15; left: 18px; right: 18px; bottom: calc(164px + env(safe-area-inset-bottom)); padding: 12px 15px; border-radius: 13px; background: rgba(30,30,30,.94); color: #fff; text-align: center; font-size: 13px; box-shadow: 0 8px 32px #0009; }
.sheet { position: absolute; z-index: 10; left: 0; right: 0; bottom: 0; padding: 16px 20px calc(24px + env(safe-area-inset-bottom)); background: rgba(18,18,18,.96); border-radius: 24px 24px 0 0; box-shadow: 0 -8px 40px #000a; backdrop-filter: blur(16px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; font-weight: 600; font-size: 15px; }
.sheet-head button { color: #e5e5e5; border: 0; background: none; padding: 8px; }
.card-readout { height: 30px; text-align: center; color: #aaa; font-size: 13px; }
.rank-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.suit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.rank-grid button, .suit-grid button { border-radius: 10px; border: 1px solid #444; background: #252525; color: #ddd; min-height: 42px; font-size: 14px; }
.rank-grid button.selected, .suit-grid button.selected { border-color: #fff; background: #555; color: #fff; }
.suit-grid button { font-size: 23px; }
.file-label { display: block; margin-top: 22px; text-align: center; font-size: 12px; color: #999; }
.file-label input { display: none; }
.code-sheet p { color: #bbb; font-size: 14px; }
.code-sheet input { width: 100%; border: 1px solid #555; border-radius: 12px; padding: 13px 14px; background: #292929; color: #fff; margin-bottom: 15px; }
.code-sheet .primary-button { width: 100%; }
@media (min-width: 700px) { .camera-app { max-width: 440px; margin: auto; box-shadow: 0 0 40px #000; } body { background: #171717; } }
